Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anyway to send Custom Method by using Java HttpClient

We are currently using HttpClient 4.3 for all REST communications with other service providers, however, one of our recent providers has some custom methods sitting within the API.

I was trying to figure out a way to send custom methods (Methods not in standard such as GET, POST, PUT, etc.).

Anyone has similar experience before by using HttpClient? Thanks!

like image 721
Yudong Li Avatar asked Sep 16 '26 05:09

Yudong Li


1 Answers

I suggest that you use the RequestBuilder class (javadoc) to construct the Request objects. The static RequestBuilder.create method allows you to specify any "method" String for your request object.

like image 93
Stephen C Avatar answered Sep 19 '26 00:09

Stephen C