Closed iceydee closed 8 years ago
I just added get_header for the mhd_request and set_header/set_cookie for the mhd_response class. (Update the the last revision of the master branch).
You can just request them via your procedure argument (note the use of pointers in the argument type):
GET / _hello = [] (mhd_response* resp)
{
resp->set_header("Content-Type", "application/json")
}
The implementation is here: https://github.com/matt-42/silicon/blob/master/silicon/backends/mhd.hh#L40
I'd like to be able to read the headers from a request and also be able to add/modify the response headers - how could that be accomplished? middleware?