I have a virtual path which returns two results: content-type followed by document.
This allows me to return text/xml, text/html, or application/json as needed.
In all these cases the return status is 200 OK, I'm not returning either Status-code or Reason-phrase.
I now realize that I sometimes want to return a status of 401 Unauthorized.
Question 1: Is there a way to set the status code without changing my virtual path definition?
It would be a lot easier for me to do something like:
- Code: Select all
'#' ⎕wi 'Notify' '<aplresult><aplmethod>Status-code</aplmethod><apldata>401</apldata></aplresult>'
when it's needed instead of changing the virtual path definition and having my functions return the status code (which is mostly 200).
Question 2:
If I change my virtual path result to include Status-code but not Reason-phrase, will the header show the correct reason?
Is the reason phrase only if I want to give my own message and not the standard one assigned to that status?
Thanks,
Brian