• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

General Query on HTTP request generation

 
Mike Thomson
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally, the request for the web server will be generated by the browser in the normal web application. When the user type in the url, the browser will convert it to HTTP request and send it to the webserver by identifying the port 80.

I want to know whether it's possible to generate the request, what the browser is generating and able send it to the web server manually.? If so, can the web server able to identify whether this request has been generated by browser or other. How can I generate the request manually and send it to the webserver?
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YES it is possible to generate the request and to send it to the server manually. I don't think that the server is able to identify that the request is from browser or something else because i think that all HTTP request format is same and it is already defined by some community.

You can use some already available libraries to generate http request. I will suggest you to make use of Apache HTTP client web page for this. It is easy to use and keeps all the low level details to itself.
[ December 03, 2008: Message edited by: Himanshu Gupta ]
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by himanshu gupta
I don't think that the server is able to identify that the request is from browser or something else because i think that all HTTP request format is same and it is already defined by some community


The User-Agent header will let you identify the browser , its version even the client's os and its version.
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Amol. But will it make any difference to server? It will come into action only when we will explicitly define some rules. Am I right?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The User-Agent header will let you identify the browser , its version even the client's os and its version.

Generally this is true, but a number of browsers let you manipulate this header, so you can't take its value for absolutely correct. Client libraries like HttpClient will send whatever the code tells them to send, so you can't be sure whether the user is a browser or a program by looking at this header.
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya Ulf thats true, we do have plugins that allow us to modify the headers, form parameters , cookies etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic