c-libcurl.js (hoppscotch-2.0.0) | : | c-libcurl.js (hoppscotch-2.1.0) | ||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
rawRequestBody, | rawRequestBody, | |||
contentType, | contentType, | |||
}) => { | }) => { | |||
const requestString = [] | const requestString = [] | |||
requestString.push("CURL *hnd = curl_easy_init();") | requestString.push("CURL *hnd = curl_easy_init();") | |||
requestString.push( | requestString.push( | |||
`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${method}");` | `curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${method}");` | |||
) | ) | |||
requestString.push( | requestString.push( | |||
`curl_easy_setopt(hnd, CURLOPT_URL, "${url}${pathName}${queryString}");` | `curl_easy_setopt(hnd, CURLOPT_URL, "${url}${pathName}?${queryString}");` | |||
) | ) | |||
requestString.push(`struct curl_slist *headers = NULL;`) | requestString.push(`struct curl_slist *headers = NULL;`) | |||
if (headers) { | if (headers) { | |||
headers.forEach(({ key, value }) => { | headers.forEach(({ key, value }) => { | |||
if (key) | if (key) | |||
requestString.push( | requestString.push( | |||
`headers = curl_slist_append(headers, "${key}: ${value}");` | `headers = curl_slist_append(headers, "${key}: ${value}");` | |||
) | ) | |||
}) | }) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |