There's definitely a way to do that internally, but it's not exposed in the XCALL HTTP interface. We could rectify that easily enough, but it requires some kind of design decision...
Assuming you want the headers in addition to the body of the response (i.e. the
response parameter), then we have to do one of the following:
- Add another parameter. (On the one hand, this is the messiest, since it would have to follow the existing two optional parameters, and it would require updating both A-Shell and the dll/lib together. And it also raises the question of whether the XHTTPF_FILERESP option should apply to this new headers parameter in the same way that it does to the response parameter.)
- Prepend or append it to the response. The complication here would be that the response typically has a specific format (xml, json, etc.) raising some questions about just how to combine the headers with it. But since it would be optional, I suppose we could adopt any kind of non-standard scheme to allow you to separate the two parts of the response.
- Just put the headers in a file with a standardized name. In the case of a file response, the simplest approach would be to just use the same file name but with a .HDR extension. But in the non-file response, it's not obvious what file should be called -- headers.txt? <jobnam>.hdr?
- Or some other idea?
Of course, if you only wanted the headers, then a new XHTTPF_HDRRESP flag could simply replace the existing response with one consisting of just the headers. But it doesn't seem likely that the headers would be useful by themselves.
I'm open to suggestions.