• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Networking  RSS feed

 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Geeks

I am doing some stuff with httpurlconnection class , and i am just curious to know the meaning of 2 lines tagged as follows. Please help me in understanding the same.



Thanks !!!
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16058
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those lines set two HTTP headers which will be sent when you use urlc to make an HTTP request.

The User-Agent header tells the HTTP server what program the client is. Web browsers put certain strings in there, which are often used by code running on the server to determine which browser the user is using (Internet Explorer, Firefox, Chrome, Safari etc.).

The Connection header specifies options for how to deal with the TCP/IP connection after sending the request or receiving the response.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!