attempting to submit orders created locally to Schwab's API. this requires setting two headers:
Content-Type as application/json
Authorization as Bearer
Bearer token authorization is required for every request, and is handled through utils.go/Handler(), which obviously works for all other requests.
however, when attempting to set both Content-Type & Authorization, i receive an error depending on which I set first.
if i set Content-Type first, i receive an error 400 - unauthorized; if i set Authorization first, i receive an error 415 - invalid content type.
this behavior persists with the setters req.Header.Add as well as req.Header.Set, as well as attempting to set the header exclusively in accounts-trading.go/Submit with req.Header = http.Header...
what happened?
attempting to submit orders created locally to Schwab's API. this requires setting two headers:
Bearer token authorization is required for every request, and is handled through utils.go/Handler(), which obviously works for all other requests.
however, when attempting to set both Content-Type & Authorization, i receive an error depending on which I set first.
if i set Content-Type first, i receive an error 400 - unauthorized; if i set Authorization first, i receive an error 415 - invalid content type.
this behavior persists with the setters req.Header.Add as well as req.Header.Set, as well as attempting to set the header exclusively in accounts-trading.go/Submit with req.Header = http.Header...
what did you expect to happen?
no errors when setting multiple headers.