Return redirect count in response object

This commit is contained in:
Dimitri Lozeve 2023-10-02 18:24:46 +02:00
parent fec113e48f
commit 772f92037f
2 changed files with 5 additions and 1 deletions

View file

@ -41,6 +41,7 @@ The response object is a namespace with the following elements:
- ~headers~: the response headers as a single string, separated by newlines.
- ~content~: the response content, as raw bytes.
- ~time~: the time the request took, in seconds.
- ~redirectCount~: the number of redirects.
If your endpoint returns text, you can use ~FromBytes~ from
[[https://github.com/mlochbaum/bqn-libs/blob/master/strings.bqn][bqn-libs/strings.bqn]] to decode UTF-8.

View file

@ -135,6 +135,8 @@ Perform←{𝕊 session:
rcodecodeEasyGetinfoLongsession.sessionPtr,curlInfo.responseCode,0
"retrieving response code"Check rcode
rredirectcountredirectCountEasyGetinfoLongsession.sessionPtr,curlInfo.redirectCount,0
"retrieving redirect count"Check rredirectcount
rtimetimeEasyGetinfoDoublesession.sessionPtr,curlInfo.totalTime,0.0
"retrieving request time"Check rtime
@ -149,8 +151,9 @@ Perform←{𝕊 session:
{
codecode,
timetime,
headersresponseHeaders,
contentcontent,
timetime,
redirectCountredirectCount,
}
}