<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mashape.unirest.http.ObjectMapper;
String jsonData = objectMapper.writeValueAsString(yourObject);
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mashape.unirest.http.ObjectMapper;
YourObject yourObject = objectMapper.readValue(jsonData, YourObject.class);
import com.mashape.unirest.http.Unirest;
Unirest.setDefaultHeader("Accept", "application/json");
Unirest.setDefaultHeader("Content-Type", "application/json");