Frequently Asked Questions / Errors
Here are some frequently asked questions about the cookiejar
How can i delete cookies from the session / jar?
Pass a new cookiejar instance to the clients SetCookiejar() method
For the shared library there is no option to delete all cookies of a session
You can delete a single cookie inside a session if you give the cookie a negative maxAge value. (Does only work for the tls_client cookiejar not the standard cookiejar)
I can not do a successful POST Request with the shared library or standalone api
Be aware that when you do a POST Request and want to provide a forwarded request body in the
requestBody
field it has to be a string. That means if you want to send JSON you need to stringify this JSON to a string first and set the correctcontent-type
header.
How can I use other request body content types besides json?
requestBody
accepts strings and forwards them as the payload. combined with thecontent-type
header the api makes the actual request body out of it. You can use for exampleapplication/x-www-form-urlencoded
content type in the header and then just provide as request body a string similar tokey=value&key=value
x509: certificate signed by unknown authority
As the message indicates you are trying to request a server which most likely has a self signed ssl certificate. There is a client option to skip the cerification.
x509: certificate has expired or is not yet valid
As the message indicates you are trying to request a server which most likely has an expired or invalid ssl certificate. There is a client option to skip the cerification.
stream error: stream ID 3; PROTOCOL_ERROR
Sometimes this happens when people set a wrong
content-length
header on the request. Usually you never need to set thecontent-length
header because the client will take care of that for you.
Last updated