Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

GetRequestHeaderField', 'Debug'

this is in my code:
If HTTP_Services('GetRequestHeaderField', 'Debug') then Debug

The web developer reports this error.
Why is there an error when all is needed to return null - Question, not a criticism

{
"type": "about:blank",
"title": "Unprocessable Entity (WebDAV; RFC 4918)",
"status": 422,
"detail": "Debug is not a header field in the request.",
"instance": "[removed]"
}



Comments

  • Told the Web developer to add 'Debug' to the header, and he still gets the error.


  • The short answer is that all service modules will use Error_Services when something unexpected occurs. When you request the value of a request header that doesn't exist, then this sets Error_Services. When the HTTP Framework is wrapping up and preparing the response, it checks Error_Services for any errors and incorporates them in the response. Thus, you are getting an undesirable response due to a non-critical error.

    In your code, try adding Error_Services('Clear') immediately after the GetRequestHeaderField call. I'm not sure why your developer is still getting the 422 response if he is including the Debug header, but this isn't something he should have to do.
Sign In or Register to comment.