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

@ -116,8 +116,8 @@ SetTimeoutms←{timeoutms 𝕊 session:
# Use a POST method and set data to post
SetData{data 𝕊 session:
"setting up POST request"Check EasySetoptLongsession.sessionPtr,curlOptions.post,1
"setting POST data"Check EasySetoptStrsession.sessionPtr,curlOptions.postfields,data
"setting POST data size"Check EasySetoptLongsession.sessionPtr,curlOptions.postfieldsize,data
"copying POST data"Check EasySetoptStrsession.sessionPtr,curlOptions.copypostfields,data
session
}