Closed gnh1201 closed 9 months ago
In cURL-based HTTP requests, if a query string with the "&"(non-escaped ampersand) character is included within JSON data, errors may occur in the command prompt.
For example:
var response = HTTP.create("CURL") .setBearerAuth("<token>") .setHeader("Accept", "application/json") .setContentType("application/json") .requestBody({ "url": "https://exmaple.org?foo=1&bar=2" // error }) .put("https://exmaple.org") // equals with: open("https://exmaple.org").send() .responseBody ; console.log(JSON.stringify(response));
As a result:
> curl -X PUT <...> -d "{\"url\": \"https://exmaple.org?foo=1&bar=2\"}" https://exmaple.org ^ (error) bar is not valid command
https://chat.openai.com/c/56b9b536-d13f-4834-b740-999a0d21dca6
Done
Summary
In cURL-based HTTP requests, if a query string with the "&"(non-escaped ampersand) character is included within JSON data, errors may occur in the command prompt.
For example:
As a result: