fix POST data not working without string literals

https://curl.se/libcurl/c/curl_easy_setopt.html

Strings passed to libcurl as 'char *' arguments, are copied by the library; the string storage associated to the pointer argument may be discarded or reused after curl_easy_setopt returns. The only exception to this rule is really CURLOPT_POSTFIELDS
This commit is contained in:
tankorsmash 2025-03-16 12:18:34 -04:00
parent d30021db16
commit b291110ffa
3 changed files with 3 additions and 2 deletions

View file

@ -36,7 +36,7 @@ simpleAPI_testsuite←⟨
},
"simple POST with headers"{𝕊𝕩:
headers"Content-Type: application/json"
rheaders Post httpbinURL"/post","{""key"": ""value""}"
rheaders Post httpbinURL"/post",¯1000 + 1000 + "{""key"": 1}"
! 200=r.code
! 0=r.redirectCount
! 1="HTTP/"r.headers