How to create a REST client to POST a JSON object to a server and receive the data in Java

I just went through a lot of internet search in order to do exactly what the title says, looks like in the Java world you need to have always a IDE like Eclipse, or even worse, Netbeans, but sometimes I just need to test a concept and I don’t want to create a project for it.

In this case I just wanted to make a simple REST client posting a JSON object and receiving the information, lots of posts uses libraries, frameworks and all kind of stuffs, but I wanted to make it the simpler possible so, here’s my code:

Continue reading

Advertisements