-1

Anybody knows how to make a http request in java for this?

Create a new class (for example LatchSDK.java) extending Latch.java. This class should override HTTP_GET method with your own implementation to perform HTTP requests as you usually perform them in your project.

 public class LatchSDK extends Latch{

      @Override
      public JsonElement HTTP_GET(String URL, Map<String, String>headers) {
           //Your implementation here
      }
 }
Daniel
  • 3
  • 1

1 Answers1

1

It can be done with the HttpURLConnection class. There are plenty of examples online on how to apply it.

Yves
  • 11
  • 1
  • Thanks, but how I can send the Mapheaders? – Daniel Nov 08 '14 at 13:43
  • You should be able to use setRequestProperty for this: `for (String header : headers.keySet()) { httpUrlConnection.setRequestProperty(header, headers.get(header); }` – Yves Nov 08 '14 at 13:50
  • Thanks again, but I get an inputstream and I need a JsonElement. I search but I dont found how to do it – Daniel Nov 08 '14 at 14:10