Closed painedpineapple closed 5 years ago
Sure. There is an example https://github.com/meafmira/bs-axios#headers
@meafmira I did notice that this is how you create headers, but what about updating them in either the axios defaults or on an instance?
I ended up doing the following where instance
is an instance of bs-axios:
let setAxiosAuthWith = [%raw {|
function(axiosInstance, header) {
| axiosInstance.defaults.headers["Authorization"] = header
| /* axios.defaults.common["Authorization"] = header */
}
|}];
let setAxiosAuth = (header: string) => setAxiosAuthWith(instance, header);
Example from JS:
Is this possible with the current bindings?