-
Apache HttpClient 4.5 HTTP GET Request Method Example
This tutorial demonstrates how to use Apache HttpClient 4.5 to make a Http GET request. The Http GET method represents a representation of the specified resource. This could be as simple as getting an HTML page, or Getting resources formatted in JSON, XML or etc. Requests using HTTP GET Request methods should be Idempotent, meaning: these should only retrieve data and should have no other effects.
Date: 2019-08-10 View: 1136
-
Apache HttpClient 4.5 HTTP POST Request Method Example
This tutorial demonstrates how to use Apache HttpClient 4.5 to make a Http POST request. The HTTP POST request method requests that the server accepts the entity enclosed in the request as a new subordinate of the web resource identified by the URI. The posted data can be, but is not limited to, an annotation for existing resources or data formatted JSON, XML or submitted FORM data. The server can use the posted data to update resources in the database, or process this data.
Date: 2019-08-10 View: 1617
-
Apache HttpClient 4.5 HTTP PUT Request Method Example
This tutorial demonstrates how to use Apache HttpClient 4.5 to make a Http PUT request. The HTTP PUT Request Method requests that the server accepts and stores the entity enclosed in the supplied URI. If the URI refers to an already existing resource, it is modified; if the URI does not point to an existing resource, then the server can create the resource with that URI.
Date: 2019-08-10 View: 1289
-
Apache HttpClient 4.5 HTTP DELETE Request Method Example
This tutorial demonstrates how to use Apache HttpClient 4.5 to make a Http DELETE request. The HTTP DELETE Request Method requests deletes the resource specified by the URI.
Date: 2019-08-10 View: 1248
-
Apache HttpClient 4.5 How to Get Server Certificates
The following tutorial demonstrates how to obtain the certificates from the resource server using Apache HttpClient 4.5. Certificates are used to secure the connection between the client and server over HTTPS using SSL/TLS. When you need details about the certificate, for example: when does the certificate expire?, who issued the certificate? or etc. You need to read the server certificate. In the following example we explain in detail how you can do this.
Date: 2019-08-10 View: 1357
-
How to Ignore Certificate Errors in Apache HttpClient 4.5
Typically, a developer will use self-signed certificates on his local machine or in development stage of the project. HttpClient (and web browsers) will not accept untrusted connections, by default. However, we can configure the HttpClient to allow untrusted self-signed certificates.
Date: 2019-08-10 View: 2003
-
Apache HttpClient 4.5 HttpRequestRetryHandler Example
In the following example we show how to create a custom HttpRequestRetryHandler in order to enable a custom exception recovery mechanism. When using this interface, we need to implement the retryRequest method. This allows us to define a custom retry count mechanism and exception recovery mechanism. Take a look at the following tutorial.
Date: 2019-08-10 View: 1326
-
Apache HttpClient Cache 4.5 Http Caching Example
HttpClient Cache provides an HTTP/1.1-compliant caching layer to be used with HttpClient–the Java equivalent of a browser cache. The following example uses the CacheConfig of the HttpClient Cache library.
Date: 2019-08-10 View: 1207
-
Apache HttpClient 4.5 HTML FORM POST Example
Many applications need to simulate the process of submitting an HTML form, for instance, in order to log in to a web application or submit input data. HttpClient provides the entity class UrlEncodedFormEntity to facilitate the process. The following tutorial shows how to send HTML Form parameters using apache HttpClient 4.5.
Date: 2019-08-10 View: 1280
-
Apache HttpClient 4.5 Redirect Handling Requests Example
HttpClient handles all types of redirects automatically, except those explicitly prohibited by the HTTP specification as requiring user intervention. See Other (status code 303) redirects on POST and PUT requests are converted to GET requests as required by the HTTP specification. One can use a custom redirect strategy to relaxe restrictions on automatic redirection of POST methods imposed by the HTTP specification. In the following tutorial we’ll us the LaxRedirectStrategy to handle http redirects.
Date: 2019-08-10 View: 1492
-
Apache HttpClient 4.5 Custom HTTP Headers Example
An HTTP message can contain a number of headers describing properties of the message such as content length, content type, authorization and so on. HttpClient provides methods to retrieve, add, remove and enumerate headers. In the following tutorial we’ll show how to add custom HTTP Headers to the HttpClient and Http request method.
Date: 2019-08-10 View: 1309
-
Apache HttpClient 4.5 Multipart Upload Request Example
In this tutorial, we demonstrate how to do a multipart upload http request using Apache HttpClient 4.5.
Date: 2019-08-10 View: 1840
-
Spring Security + Spring LDAP Authentication Configuration Example
In this tutorial we demonstrate how to Configure Spring Security + Spring LDAP authentication application. We show how to configure spring security and spring LDAP using Java And XML Configuration.
Date: 2019-08-10 View: 3535
-
Spring Boot + Spring Security + Thymeleaf Form Login Example
This tutorial demonstrates how to configure spring-boot, spring-security and thymeleaf with form-login. We secure our web application using spring security form-login. We create a reusable Thymeleaf layout which we can use to create our secured and unsecured pages. When a user accesses a protected resource with insufficient rights we redirect the user to an access-denied page. Finally we create a login page where the user is able to login to the application. And we create a logout link.
Date: 2019-08-10 View: 3146
-
Spring Security Basic Authentication Configuration Example
The following tutorial is about Spring Security Basic Authentication Configuration. We demonstrate this by configuring Spring Security using both Java and XML Configuration. We create a custom authentication entry point which we can use and customize to give the user a custom login error message. We finish with showing how to write some integration tests using Spring MockMvc and JUnit.
Date: 2019-08-10 View: 1855