Complete
over 5 years ago

WERETECH-8555

Custom headers in makeWebRequest cause INVALID_HTTP_HEADER_FIELDS_IN_REQUEST error

* Use Communications.makeWebRequest with custom (non-standard) headers required by a particular web API.

* Response code is always INVALID_HTTP_HEADER_FIELDS_IN_REQUEST unless standard headers are used, in which case the web service rejects request.

Headers must be getting validated against a known allowed set. Why limit this? Limitation/bug.

S

Former Member
Former Member
  • Former Member We're closing our investigation of this issue for now, but if you continue to have trouble with this or have more info you can provide, please post back to this thread.

  • We have tests that verify sending a non-standard header, so this should not be an issue.

    I looked through the device/simulator code and I'm not seeing anything that indicates we are blocking non-standard headers either. As far as I can tell, we 

    1. ensure that the value associated with the :headers option is a Lang.Dictionary
    2. ensure that the key associated with each header is a Lang.String
    3. ensure that the request type (GET/PUT/POST/DELETE/..) is consistent with the Content-Type header (if provided)
    4. ensure that the value associated with each header is a Lang.String

    Are you seeing this behavior in the simulator, on devices, or both?

    Could you show a snippet of the code that you're using to generate the headers so we can try to determine where the problem lies?