let headers = Axios.Headers.fromDict(headersDict);
Axios.getc("https://example.com", Axios.makeConfig(~headers, ()));
I noticed that Axios appends default headers, like Accept: application/json, text/plain, */*. The service I am trying to connect with doesn't accept the Accept headers, and throws me a 406 -- Not Acceptable error.
Also, when I set the header dict like dict.set("accept", "*/*"), I noticed that the Accept header value gets appended with */* instead of being replace. The Accept header ultimately looks like:
Accept: application/json, text/plain, */*, */*.
Following the example for Headers in the readme:
I noticed that Axios appends default headers, like
Accept: application/json, text/plain, */*
. The service I am trying to connect with doesn't accept theAccept
headers, and throws me a 406 -- Not Acceptable error.Also, when I set the header dict like
dict.set("accept", "*/*")
, I noticed that theAccept
header value gets appended with*/*
instead of being replace. TheAccept
header ultimately looks like:Accept: application/json, text/plain, */*, */*
.I noticed that there is a way to remove the default header for the js library: https://stackoverflow.com/questions/46656474/axios-remove-headers-authorization-in-1-call-only
Is there a way to remove default headers? Or override them?