1

I have written a simple HTTP server using Java and want to send some additional information (puzzle parameters and a small puzzle solver program) to the client i.e. a regular browser.

Similarly, the browser is also supposed to send information (solution) back to the server.

Is there a way to do this by just transmitting this information over the HTTP headers?

Thanks a lot

1
  • 4
    You could use cookies...though generally, such information is sent in the body as opposed the header. Is there a reason you want to use headers to send the info? Commented Jul 21, 2012 at 20:22

1 Answer 1

3

the headers are usually used to add http protocol relevant information. You should probably use either the body of the response or cookies to add the needed information. Adding a cookie is done using the header so it kind of fits what you are asking for.

But I wonder why you need to put it in the header? it seems like what you are asking for is url parameters (client to server) and response body (server to client).

Sign up to request clarification or add additional context in comments.

1 Comment

There is no particular reason why I want to use headers. I was just exploring different options to exchange information between the server and client. The client (browser) should be able to process everything within itself, to be precise be as transparent as possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.