Home » Core Java » net » URLConnection

URLConnection

Get response headers from HTTP request

With this example we are going to demonstrate how to get response headers from an HTTP request in Java. In short, to get the response headers from an HTTP request you should : Create a URL Object that represents the resource you want to access Use the openConnection() API method of the URL Object to access connection specific parameters for ...

Read More »

Send cookie with HTTP request

This is an example of how to send a cookie with an HTTP request in Java. In short, to send cookies with HTTP requests one should : Create a URL Object that represents the resource you want to access Use the openConnection() API method of the URL Object to access connection specific parameters for the HTTP request Use the setRequestProperty() ...

Read More »

Get cookies from HTTP connection

With this example we are going to demonstrate how to get cookies from an HTTP connection in Java. In short, to retrieve cookie information of a URL connection you should Create a URL Object that represents the resource you want to access Use the openConnection() API method of the URL Object to access connection specific parameters for the HTTP request ...

Read More »