Can I make my own HTTP header attribute?
Can I create my own headers in HTTP request
?
eg. itnormal HTTP request
GET / HTTP/1.1
Host: google.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT x.x; xx; rv:x.x.x.x) xxx Firefox/3.0.10 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: xx,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1250,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
and this is a header with my "attribute"
GET / HTTP/1.1
Host: google.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT x.x; xx; rv:x.x.x.x) xxx Firefox/3.0.10 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: xx,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1250,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Name: John
and I will have the attribute in the server response. I will use "attrubutes" in HTTP headers instead of session attributes ...
BTW. Sorry for my english...;)
a source to share
You can write a small proxy application. It receives the client's request, adds the appropriate attribute, and redirects it to the server. I suggest this solution because in my experience it happens that you need to enrich the content of the http header in order to implement integration between multiple web applications.
The behavior I just described is implemented, for example, by Tivoli Access Manager to redirect the received LDAP information to a background application. Servers.
Sorry if my answer seems off-topic.
a source to share
It seems like your question is about headers in REQUEST , i.e. on the server from the client. You cannot force the client to send any custom header from the server side.
The use response.setHeader("Name", "John")
will only send this response back, but the client will not send it back. Unfortunately.
a source to share
Yes, you can. But why do you want?
The HTTP protocol allows you to configure your own custom headers. However, this would also mean that your server would need to understand your custom headers. So this solution will only work in your custom application and not across the board. It can also make it difficult to save / debug in the future if you don't accurately document all of these settings.
I would say wmeyer said to use cookies.
a source to share