EVOLUTION-MANAGER
Edit File: cpl__http_8h.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.5"/> <title>SDTS_AL: cpl_http.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">SDTS_AL </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_651562d8bf6cfd3e81eff5b570d7df50.html">port</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">cpl_http.h File Reference</div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><code>#include "<a class="el" href="cpl__conv_8h_source.html">cpl_conv.h</a>"</code><br/> <code>#include "<a class="el" href="cpl__string_8h_source.html">cpl_string.h</a>"</code><br/> <code>#include "cpl_progress.h"</code><br/> <code>#include "<a class="el" href="cpl__vsi_8h_source.html">cpl_vsi.h</a>"</code><br/> </div> <p><a href="cpl__http_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structCPLMimePart.html">CPLMimePart</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:a14d7c54d96748caa3082795e0b06791a"><td class="memItemLeft" align="right" valign="top">int CPL_DLL </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#a14d7c54d96748caa3082795e0b06791a">CPLHTTPEnabled</a> (void)</td></tr> <tr class="memdesc:a14d7c54d96748caa3082795e0b06791a"><td class="mdescLeft"> </td><td class="mdescRight">Return if CPLHTTP services can be useful. <a href="#a14d7c54d96748caa3082795e0b06791a">More...</a><br/></td></tr> <tr class="separator:a14d7c54d96748caa3082795e0b06791a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a580011bf6fb159c04621e174c4f5c13a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> CPL_DLL * </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#a580011bf6fb159c04621e174c4f5c13a">CPLHTTPFetch</a> (const char *pszURL, <a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> papszOptions)</td></tr> <tr class="memdesc:a580011bf6fb159c04621e174c4f5c13a"><td class="mdescLeft"> </td><td class="mdescRight">Fetch a document from an url and return in a string. <a href="#a580011bf6fb159c04621e174c4f5c13a">More...</a><br/></td></tr> <tr class="separator:a580011bf6fb159c04621e174c4f5c13a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:afb2ce5b055d70e051db9723919f542f0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> CPL_DLL * </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#afb2ce5b055d70e051db9723919f542f0">CPLHTTPFetchEx</a> (const char *pszURL, <a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg, CPLHTTPFetchWriteFunc pfnWrite, void *pWriteArg)</td></tr> <tr class="separator:afb2ce5b055d70e051db9723919f542f0"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:acc118a9e2bc18b1cc3d71ffd1887d9d6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> CPL_DLL ** </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#acc118a9e2bc18b1cc3d71ffd1887d9d6">CPLHTTPMultiFetch</a> (const char *const *papszURL, int nURLCount, int nMaxSimultaneous, <a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> papszOptions)</td></tr> <tr class="memdesc:acc118a9e2bc18b1cc3d71ffd1887d9d6"><td class="mdescLeft"> </td><td class="mdescRight">Fetch several documents at once. <a href="#acc118a9e2bc18b1cc3d71ffd1887d9d6">More...</a><br/></td></tr> <tr class="separator:acc118a9e2bc18b1cc3d71ffd1887d9d6"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aaed13abba737e85cc733d3423fc737eb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaed13abba737e85cc733d3423fc737eb"></a> void CPL_DLL </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#aaed13abba737e85cc733d3423fc737eb">CPLHTTPCleanup</a> (void)</td></tr> <tr class="memdesc:aaed13abba737e85cc733d3423fc737eb"><td class="mdescLeft"> </td><td class="mdescRight">Cleanup function to call at application termination. <br/></td></tr> <tr class="separator:aaed13abba737e85cc733d3423fc737eb"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a41f8024cb1a1b5b9826f347cc80100d9"><td class="memItemLeft" align="right" valign="top">void CPL_DLL </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#a41f8024cb1a1b5b9826f347cc80100d9">CPLHTTPDestroyResult</a> (<a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> *psResult)</td></tr> <tr class="memdesc:a41f8024cb1a1b5b9826f347cc80100d9"><td class="mdescLeft"> </td><td class="mdescRight">Clean the memory associated with the return value of <a class="el" href="cpl__http_8h.html#a580011bf6fb159c04621e174c4f5c13a" title="Fetch a document from an url and return in a string. ">CPLHTTPFetch()</a> <a href="#a41f8024cb1a1b5b9826f347cc80100d9">More...</a><br/></td></tr> <tr class="separator:a41f8024cb1a1b5b9826f347cc80100d9"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:add96dd3f61497cd87d09d1227f2e7ff0"><td class="memItemLeft" align="right" valign="top">void CPL_DLL </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#add96dd3f61497cd87d09d1227f2e7ff0">CPLHTTPDestroyMultiResult</a> (<a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> **papsResults, int nCount)</td></tr> <tr class="memdesc:add96dd3f61497cd87d09d1227f2e7ff0"><td class="mdescLeft"> </td><td class="mdescRight">Clean the memory associated with the return value of <a class="el" href="cpl__http_8h.html#acc118a9e2bc18b1cc3d71ffd1887d9d6" title="Fetch several documents at once. ">CPLHTTPMultiFetch()</a> <a href="#add96dd3f61497cd87d09d1227f2e7ff0">More...</a><br/></td></tr> <tr class="separator:add96dd3f61497cd87d09d1227f2e7ff0"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa682e6e527c012942ca9cea7383cea27"><td class="memItemLeft" align="right" valign="top">int CPL_DLL </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#aa682e6e527c012942ca9cea7383cea27">CPLHTTPParseMultipartMime</a> (<a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> *psResult)</td></tr> <tr class="memdesc:aa682e6e527c012942ca9cea7383cea27"><td class="mdescLeft"> </td><td class="mdescRight">Parses a MIME multipart message. <a href="#aa682e6e527c012942ca9cea7383cea27">More...</a><br/></td></tr> <tr class="separator:aa682e6e527c012942ca9cea7383cea27"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a9dfbd661df8bacbb98bb7d30cf17f054"><td class="memItemLeft" align="right" valign="top">char CPL_DLL * </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#a9dfbd661df8bacbb98bb7d30cf17f054">GOA2GetAuthorizationURL</a> (const char *pszScope)</td></tr> <tr class="separator:a9dfbd661df8bacbb98bb7d30cf17f054"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aebbd317262610ededec9b2530acd3b95"><td class="memItemLeft" align="right" valign="top">char CPL_DLL * </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#aebbd317262610ededec9b2530acd3b95">GOA2GetRefreshToken</a> (const char *pszAuthToken, const char *pszScope)</td></tr> <tr class="separator:aebbd317262610ededec9b2530acd3b95"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a86291e3499c1a2c3c5e01ba79c163a16"><td class="memItemLeft" align="right" valign="top">char CPL_DLL ** </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#a86291e3499c1a2c3c5e01ba79c163a16">GOA2GetAccessTokenFromServiceAccount</a> (const char *pszPrivateKey, const char *pszClientEmail, const char *pszScope, <a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> papszAdditionalClaims, <a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> papszOptions)</td></tr> <tr class="separator:a86291e3499c1a2c3c5e01ba79c163a16"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a8e4d0a9480ce2866689ea10e1c46cb23"><td class="memItemLeft" align="right" valign="top">char CPL_DLL ** </td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__http_8h.html#a8e4d0a9480ce2866689ea10e1c46cb23">GOA2GetAccessTokenFromCloudEngineVM</a> (<a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> papszOptions)</td></tr> <tr class="separator:a8e4d0a9480ce2866689ea10e1c46cb23"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Interface for downloading HTTP, FTP documents </p> </div><h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="add96dd3f61497cd87d09d1227f2e7ff0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void CPL_DLL CPLHTTPDestroyMultiResult </td> <td>(</td> <td class="paramtype"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> ** </td> <td class="paramname"><em>papsResults</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>nCount</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Clean the memory associated with the return value of <a class="el" href="cpl__http_8h.html#acc118a9e2bc18b1cc3d71ffd1887d9d6" title="Fetch several documents at once. ">CPLHTTPMultiFetch()</a> </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">papsResults</td><td>pointer to the return value of <a class="el" href="cpl__http_8h.html#acc118a9e2bc18b1cc3d71ffd1887d9d6" title="Fetch several documents at once. ">CPLHTTPMultiFetch()</a> </td></tr> <tr><td class="paramname">nCount</td><td>value of the nURLCount parameter passed to <a class="el" href="cpl__http_8h.html#acc118a9e2bc18b1cc3d71ffd1887d9d6" title="Fetch several documents at once. ">CPLHTTPMultiFetch()</a> </td></tr> </table> </dd> </dl> <dl class="section since"><dt>Since</dt><dd>GDAL 2.3 </dd></dl> </div> </div> <a class="anchor" id="a41f8024cb1a1b5b9826f347cc80100d9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void CPL_DLL CPLHTTPDestroyResult </td> <td>(</td> <td class="paramtype"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> * </td> <td class="paramname"><em>psResult</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Clean the memory associated with the return value of <a class="el" href="cpl__http_8h.html#a580011bf6fb159c04621e174c4f5c13a" title="Fetch a document from an url and return in a string. ">CPLHTTPFetch()</a> </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">psResult</td><td>pointer to the return value of <a class="el" href="cpl__http_8h.html#a580011bf6fb159c04621e174c4f5c13a" title="Fetch a document from an url and return in a string. ">CPLHTTPFetch()</a> </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a14d7c54d96748caa3082795e0b06791a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int CPL_DLL CPLHTTPEnabled </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return if CPLHTTP services can be useful. </p> <p>Those services depend on GDAL being build with libcurl support.</p> <dl class="section return"><dt>Returns</dt><dd>TRUE if libcurl support is enabled </dd></dl> </div> </div> <a class="anchor" id="a580011bf6fb159c04621e174c4f5c13a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> CPL_DLL* CPLHTTPFetch </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>pszURL</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> </td> <td class="paramname"><em>papszOptions</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Fetch a document from an url and return in a string. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pszURL</td><td>valid URL recognized by underlying download library (libcurl) </td></tr> <tr><td class="paramname">papszOptions</td><td>option list as a NULL-terminated array of strings. May be NULL. The following options are handled : <ul> <li> CONNECTTIMEOUT=val, where val is in seconds (possibly with decimals). This is the maximum delay for the connection to be established before being aborted (GDAL >= 2.2). </li> <li> TIMEOUT=val, where val is in seconds. This is the maximum delay for the whole request to complete before being aborted. </li> <li> LOW_SPEED_TIME=val, where val is in seconds. This is the maximum time where the transfer speed should be below the LOW_SPEED_LIMIT (if not specified 1b/s), before the transfer to be considered too slow and aborted. (GDAL >= 2.1) </li> <li> LOW_SPEED_LIMIT=val, where val is in bytes/second. See LOW_SPEED_TIME. Has only effect if LOW_SPEED_TIME is specified too. (GDAL >= 2.1) </li> <li> HEADERS=val, where val is an extra header to use when getting a web page. For example "Accept: application/x-ogcwkt" </li> <li> HEADER_FILE=filename: filename of a text file with "key: value" headers. (GDAL >= 2.2) </li> <li> HTTPAUTH=[BASIC/NTLM/GSSNEGOTIATE/ANY] to specify an authentication scheme to use. </li> <li> USERPWD=userid:password to specify a user and password for authentication </li> <li> POSTFIELDS=val, where val is a nul-terminated string to be passed to the server with a POST request. </li> <li> PROXY=val, to make requests go through a proxy server, where val is of the form proxy.server.com:port_number </li> <li> PROXYUSERPWD=val, where val is of the form username:password </li> <li> PROXYAUTH=[BASIC/NTLM/DIGEST/ANY] to specify an proxy authentication scheme to use. </li> <li> NETRC=[YES/NO] to enable or disable use of $HOME/.netrc, default YES. </li> <li> CUSTOMREQUEST=val, where val is GET, PUT, POST, DELETE, etc.. (GDAL >= 1.9.0) </li> <li> COOKIE=val, where val is formatted as COOKIE1=VALUE1; COOKIE2=VALUE2; ... </li> <li> MAX_RETRY=val, where val is the maximum number of retry attempts if a 429, 502, 503 or 504 HTTP error occurs. Default is 0. (GDAL >= 2.0) </li> <li> RETRY_DELAY=val, where val is the number of seconds between retry attempts. Default is 30. (GDAL >= 2.0) </li> <li> MAX_FILE_SIZE=val, where val is a number of bytes (GDAL >= 2.2) </li> <li> CAINFO=/path/to/bundle.crt. This is path to Certificate Authority (CA) bundle file. By default, it will be looked in a system location. If the CAINFO options is not defined, GDAL will also look if the CURL_CA_BUNDLE environment variable is defined to use it as the CAINFO value, and as a fallback to the SSL_CERT_FILE environment variable. (GDAL >= 2.1.3) </li> <li> HTTP_VERSION=1.0/1.1/2/2TLS (GDAL >= 2.3). Specify HTTP version to use. Will default to 1.1 generally (except on some controlled environments, like Google Compute Engine VMs, where 2TLS will be the default). Support for HTTP/2 requires curl 7.33 or later, built against nghttp2. "2TLS" means that HTTP/2 will be attempted for HTTPS connections only. Whereas "2" means that HTTP/2 will be attempted for HTTP or HTTPS. </li> <li> SSL_VERIFYSTATUS=YES/NO (GDAL >= 2.3, and curl >= 7.41): determines whether the status of the server cert using the "Certificate Status Request" TLS extension (aka. OCSP stapling) should be checked. If this option is enabled but the server does not support the TLS extension, the verification will fail. Default to NO. </li> <li> USE_CAPI_STORE=YES/NO (GDAL >= 2.3, Windows only): whether CA certificates from the Windows certificate store. Defaults to NO. </li> </ul> </td></tr> </table> </dd> </dl> <p>Alternatively, if not defined in the papszOptions arguments, the CONNECTTIMEOUT, TIMEOUT, LOW_SPEED_TIME, LOW_SPEED_LIMIT, USERPWD, PROXY, PROXYUSERPWD, PROXYAUTH, NETRC, MAX_RETRY and RETRY_DELAY, HEADER_FILE, HTTP_VERSION, SSL_VERIFYSTATUS, USE_CAPI_STORE values are searched in the configuration options respectively named GDAL_HTTP_CONNECTTIMEOUT, GDAL_HTTP_TIMEOUT, GDAL_HTTP_LOW_SPEED_TIME, GDAL_HTTP_LOW_SPEED_LIMIT, GDAL_HTTP_USERPWD, GDAL_HTTP_PROXY, GDAL_HTTP_PROXYUSERPWD, GDAL_PROXY_AUTH, GDAL_HTTP_NETRC, GDAL_HTTP_MAX_RETRY, GDAL_HTTP_RETRY_DELAY, GDAL_HTTP_HEADER_FILE, GDAL_HTTP_VERSION, GDAL_HTTP_SSL_VERIFYSTATUS, GDAL_HTTP_USE_CAPI_STORE</p> <dl class="section return"><dt>Returns</dt><dd>a CPLHTTPResult* structure that must be freed by <a class="el" href="cpl__http_8h.html#a41f8024cb1a1b5b9826f347cc80100d9" title="Clean the memory associated with the return value of CPLHTTPFetch() ">CPLHTTPDestroyResult()</a>, or NULL if libcurl support is disabled </dd></dl> </div> </div> <a class="anchor" id="afb2ce5b055d70e051db9723919f542f0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> CPL_DLL* CPLHTTPFetchEx </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>pszURL</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> </td> <td class="paramname"><em>papszOptions</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">GDALProgressFunc </td> <td class="paramname"><em>pfnProgress</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"><em>pProgressArg</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">CPLHTTPFetchWriteFunc </td> <td class="paramname"><em>pfnWrite</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"><em>pWriteArg</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Fetch a document from an url and return in a string. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pszURL</td><td>Url to fetch document from web. </td></tr> <tr><td class="paramname">papszOptions</td><td>Option list as a NULL-terminated array of strings. Available keys see in CPLHTTPFetch. </td></tr> <tr><td class="paramname">pfnProgress</td><td>Callback for reporting algorithm progress matching the GDALProgressFunc() semantics. May be NULL. </td></tr> <tr><td class="paramname">pProgressArg</td><td>Callback argument passed to pfnProgress. </td></tr> <tr><td class="paramname">pfnWrite</td><td>Write function pointer matching the CPLHTTPWriteFunc() semantics. May be NULL. </td></tr> <tr><td class="paramname">pWriteArg</td><td>Argument which will pass to a write function. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>A CPLHTTPResult* structure that must be freed by <a class="el" href="cpl__http_8h.html#a41f8024cb1a1b5b9826f347cc80100d9" title="Clean the memory associated with the return value of CPLHTTPFetch() ">CPLHTTPDestroyResult()</a>, or NULL if libcurl support is disabled. </dd></dl> </div> </div> <a class="anchor" id="acc118a9e2bc18b1cc3d71ffd1887d9d6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> CPL_DLL** CPLHTTPMultiFetch </td> <td>(</td> <td class="paramtype">const char *const * </td> <td class="paramname"><em>papszURL</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>nURLCount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>nMaxSimultaneous</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> </td> <td class="paramname"><em>papszOptions</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Fetch several documents at once. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">papszURL</td><td>array of valid URLs recognized by underlying download library (libcurl) </td></tr> <tr><td class="paramname">nURLCount</td><td>number of URLs of papszURL </td></tr> <tr><td class="paramname">nMaxSimultaneous</td><td>maximum number of downloads to issue simultaneously. Any negative or zer value means unlimited. </td></tr> <tr><td class="paramname">papszOptions</td><td>option list as a NULL-terminated array of strings. May be NULL. Refer to <a class="el" href="cpl__http_8h.html#a580011bf6fb159c04621e174c4f5c13a" title="Fetch a document from an url and return in a string. ">CPLHTTPFetch()</a> for valid options. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>an array of CPLHTTPResult* structures that must be freed by <a class="el" href="cpl__http_8h.html#add96dd3f61497cd87d09d1227f2e7ff0" title="Clean the memory associated with the return value of CPLHTTPMultiFetch() ">CPLHTTPDestroyMultiResult()</a> or NULL if libcurl support is disabled</dd></dl> <dl class="section since"><dt>Since</dt><dd>GDAL 2.3 </dd></dl> </div> </div> <a class="anchor" id="aa682e6e527c012942ca9cea7383cea27"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int CPL_DLL CPLHTTPParseMultipartMime </td> <td>(</td> <td class="paramtype"><a class="el" href="structCPLHTTPResult.html">CPLHTTPResult</a> * </td> <td class="paramname"><em>psResult</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Parses a MIME multipart message. </p> <p>This function will iterate over each part and put it in a separate element of the pasMimePart array of the provided psResult structure.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">psResult</td><td>pointer to the return value of <a class="el" href="cpl__http_8h.html#a580011bf6fb159c04621e174c4f5c13a" title="Fetch a document from an url and return in a string. ">CPLHTTPFetch()</a> </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>TRUE if the message contains MIME multipart message. </dd></dl> </div> </div> <a class="anchor" id="a8e4d0a9480ce2866689ea10e1c46cb23"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">char CPL_DLL** GOA2GetAccessTokenFromCloudEngineVM </td> <td>(</td> <td class="paramtype"><a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> </td> <td class="paramname"><em>papszOptions</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Fetch access token using Cloud Engine internal REST API</p> <p>The default service accounts bound to the current Google Cloud Engine VM is used for OAuth2 authentication</p> <p>A CPLError will be reported if the request fails for some reason. Common reasons include the refresh token having been revoked by the user or http connection problems.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">papszOptions</td><td>NULL terminated list of options. None currently</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>a list of key=value pairs, including a access_token and expires_in </dd></dl> <dl class="section since"><dt>Since</dt><dd>GDAL 2.3 </dd></dl> </div> </div> <a class="anchor" id="a86291e3499c1a2c3c5e01ba79c163a16"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">char CPL_DLL** GOA2GetAccessTokenFromServiceAccount </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>pszPrivateKey</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>pszClientEmail</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>pszScope</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> </td> <td class="paramname"><em>papszAdditionalClaims</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="cpl__port_8h.html#ad6399986f130f30db93917dd65434a06">CSLConstList</a> </td> <td class="paramname"><em>papszOptions</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Fetch access token using Service Account OAuth2</p> <p>See <a href="https://developers.google.com/identity/protocols/OAuth2ServiceAccount">https://developers.google.com/identity/protocols/OAuth2ServiceAccount</a></p> <p>A CPLError will be reported if the request fails for some reason.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pszPrivateKey</td><td>Private key as a RSA private key </td></tr> <tr><td class="paramname">pszClientEmail</td><td>Client email </td></tr> <tr><td class="paramname">pszScope</td><td>the service being requested </td></tr> <tr><td class="paramname">papszAdditionalClaims</td><td>additional claims, or NULL </td></tr> <tr><td class="paramname">papszOptions</td><td>NULL terminated list of options. None currently</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>a list of key=value pairs, including a access_token and expires_in </dd></dl> <dl class="section since"><dt>Since</dt><dd>GDAL 2.3 </dd></dl> <p>See <a href="https://developers.google.com/identity/protocols/OAuth2ServiceAccount">https://developers.google.com/identity/protocols/OAuth2ServiceAccount</a> and <a href="https://jwt.io/">https://jwt.io/</a> </p> </div> </div> <a class="anchor" id="a9dfbd661df8bacbb98bb7d30cf17f054"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">char CPL_DLL* GOA2GetAuthorizationURL </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>pszScope</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return authorization url for a given scope.</p> <p>Returns the URL that a user should visit, and use for authentication in order to get an "auth token" indicating their willingness to use a service.</p> <p>Note that when the user visits this url they will be asked to login (using a google/gmail/etc) account, and to authorize use of the requested scope for the application "GDAL/OGR". Once they have done so, they will be presented with a lengthy string they should "enter into their application". This is the "auth token" to be passed to <a class="el" href="cpl__http_8h.html#aebbd317262610ededec9b2530acd3b95">GOA2GetRefreshToken()</a>. The "auth token" can only be used once.</p> <p>This function should never fail.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pszScope</td><td>the service being requested, not yet URL encoded, such as "https://www.googleapis.com/auth/fusiontables".</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the URL to visit - should be freed with <a class="el" href="cpl__conv_8h.html#a21b7f312da39ddb0a12bdde06b153b48">CPLFree()</a>. </dd></dl> </div> </div> <a class="anchor" id="aebbd317262610ededec9b2530acd3b95"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">char CPL_DLL* GOA2GetRefreshToken </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>pszAuthToken</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>pszScope</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Turn Auth Token into a Refresh Token.</p> <p>A one time "auth token" provided by the user is turned into a reusable "refresh token" using a google oauth2 web service.</p> <p>A CPLError will be reported if the translation fails for some reason. Common reasons include the auth token already having been used before, it not being appropriate for the passed scope and configured client api or http connection problems. NULL is returned on error.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pszAuthToken</td><td>the authorization token from the user. </td></tr> <tr><td class="paramname">pszScope</td><td>the scope for which it is valid.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>refresh token, to be freed with <a class="el" href="cpl__conv_8h.html#a21b7f312da39ddb0a12bdde06b153b48">CPLFree()</a>, null on failure. </dd></dl> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.5 </small></address> </body> </html>