PICout::withExternalBufferAnd decomposed to PICout::withExternalBufferAndID and PICout::withExternalBufferAnd
PIString::toPercentageEncoding/fromPercentageEncoding piStringify() PIHTTPClient support arguments some doc
This commit is contained in:
@@ -36,6 +36,16 @@ bool PIHTTPClient::init() {
|
||||
if (is_cancel) return false;
|
||||
PRIVATE->handle = curl_easy_init();
|
||||
if (!PRIVATE->handle) return false;
|
||||
auto ait = request.arguments().makeIterator();
|
||||
while (ait.next()) {
|
||||
if (!url.contains('?'))
|
||||
url.append('?');
|
||||
else
|
||||
url.append('&');
|
||||
url.append(ait.key().toPercentageEncoding());
|
||||
url.append('=');
|
||||
url.append(ait.value().toPercentageEncoding());
|
||||
}
|
||||
curl_easy_setopt(PRIVATE->handle, CURLOPT_WRITEDATA, this);
|
||||
curl_easy_setopt(PRIVATE->handle, CURLOPT_READDATA, this);
|
||||
curl_easy_setopt(PRIVATE->handle, CURLOPT_XFERINFODATA, this);
|
||||
@@ -156,6 +166,7 @@ PIHTTPClient * PIHTTPClient::create(const PIString & url_, PIHTTP::Method method
|
||||
PIHTTPClient * ret = new PIHTTPClient();
|
||||
static_cast<PIHTTP::MessageConst &>(ret->request) = req;
|
||||
ret->request.setMethod(method);
|
||||
ret->reply.setMethod(method);
|
||||
ret->url = url_;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user