Merge f76c284ae9
into d30021db16
This commit is contained in:
commit
9ea09ca94b
3 changed files with 4 additions and 3 deletions
2
curl.bqn
2
curl.bqn
|
@ -116,8 +116,8 @@ SetTimeoutms←{timeoutms 𝕊 session:
|
|||
# Use a POST method and set data to post
|
||||
SetData←{data 𝕊 session:
|
||||
"setting up POST request"Check EasySetoptLong⟨session.sessionPtr,curlOptions.post,1⟩
|
||||
"setting POST data"Check EasySetoptStr⟨session.sessionPtr,curlOptions.postfields,data⟩
|
||||
"setting POST data size"Check EasySetoptLong⟨session.sessionPtr,curlOptions.postfieldsize,≠data⟩
|
||||
"copying POST data"Check EasySetoptStr⟨session.sessionPtr,curlOptions.copypostfields,data⟩
|
||||
session
|
||||
}
|
||||
|
||||
|
|
1
ffi.bqn
1
ffi.bqn
|
@ -74,6 +74,7 @@ curlOptions←{
|
|||
writedata⇐ptrOffset+1 # FILE* in which to write response content
|
||||
postfields⇐ptrOffset+15 # pointer to POST input data
|
||||
headerdata⇐ptrOffset+29 # FILE* in which to write response headers
|
||||
copypostfields⇐ptrOffset+165 # copy POST input data
|
||||
|
||||
# linked list options
|
||||
httpHeader⇐slistOffset+23 # HTTP headers as a list of strings
|
||||
|
|
|
@ -36,14 +36,14 @@ simpleAPI_testsuite←⟨
|
|||
},
|
||||
"simple POST with headers"‿{𝕊𝕩:
|
||||
headers←⟨"Content-Type: application/json"⟩
|
||||
r←headers Post ⟨httpbinURL∾"/post","{""key"": ""value""}"⟩
|
||||
r←headers 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
|
||||
}
|
||||
⟩
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue