I'm writing a small REST client to use for testing my REST server app. The
relevant code looks something like this:
Client client = new Client(Protocol.HTTP);
Request request = new Request();
// build request from UI input
// ...
// add any header fields defined by user
// one of these is "X-Target-Location"
request.getAttributes().put(headerName, headerValue);
// Send request to server
Response response = client.handle(request);
My problem:
In the server code, when the request arrives, and my custom Resource is invoked
to handle it, not all of the HTTP headers from the request are present. I
expected the following Form to include all headers added in the client above:
(Form) getRequest().getAttributes().get("org.restlet.http.headers");
It includes various standard HTTP headers, but not the custom
"X-Target-Location" header. I also stepped through everything in
getRequest().getAttributes() but don't see it hiding anywhere else ...
What happens to custom HTTP headers, and where can I find them?
Note, please, that I tested the server using a different client and the custom
header came through fine there. This leads me to believe that my error is in the
client Request code, but I don't know where?
Thank you,
Ben.