Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there an equivalent to python's request module in Java for working on REST based App

Tags:

I am looking for an equivalent Java API lib which can do same things as Python's HTTP Requests module.

Key features of the Requests lib:

  1. One-step initialization of an HTTP request returns response object.
  2. The response object contains methods/member-vars to quickly access response status, headers, body/data, and a JSON-parsing method.
like image 816
pyth Avatar asked Mar 07 '12 11:03

pyth


People also ask

Is requests module built in Python?

Dealing with HTTP requests is not an easy task in any programming language. If we talk about Python, it comes with two built-in modules, urllib and urllib2 , to handle HTTP related operation.


1 Answers

Although I've not had the chance to use it much Unirest looks like a good option for people looking for the eloquence and ease of use of Python's Requests module in Java.

For simple use cases it looks much quicker to get things done than Httpcomponents (which it uses under the hood).

like image 191
Joshua Hutchison Avatar answered Sep 28 '22 09:09

Joshua Hutchison