This commit is contained in:
TankorSmash 2025-03-16 09:32:38 -07:00 committed by GitHub
commit 9ea09ca94b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 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
}

View file

@ -74,6 +74,7 @@ curlOptions←{
writedataptrOffset+1 # FILE* in which to write response content
postfieldsptrOffset+15 # pointer to POST input data
headerdataptrOffset+29 # FILE* in which to write response headers
copypostfieldsptrOffset+165 # copy POST input data
# linked list options
httpHeaderslistOffset+23 # HTTP headers as a list of strings

View file

@ -36,14 +36,14 @@ 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
! 1=+´"Content-Type: "r.headers
! 1=+´"Content-Length: "r.headers
! 1=+´"""Content-Type"": ""application/json"""r.content
! 1=+´"""data"": ""{\""key\"": \""value\""}"""r.content
! 1=+´"""data"": ""{\""key\"": 1}""" r.content
}