@@ -0,0 +1,1878 @@
+import java.io.BufferedReader;%0Aimport java.io.DataOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.net.MalformedURLException;%0Aimport java.net.URL;%0Aimport javax.net.ssl.HttpsURLConnection;%0A%0Apublic class HTTPRequest%7B%0A%09private URL url;%0A%09/**%0A%09 * %0A%09 * @param url A donde hacer la peticion%0A%09 * @throws MalformedURLException%0A%09 */%0A%09public HTTPRequest(String url) throws MalformedURLException%7B%0A%09%09this.url = new URL(url);%0A%09%7D%0A%0A%09/**%0A%09 * %0A%09 * @param headers parejas de valores a insertar en la peticion%0A%09 * @return String con la informacion%0A%09 * @throws Exception%0A%09 */%0A%09public String sendGet(String%5B%5D%5B%5D headers) throws Exception %7B%0A%0A%09%09HttpsURLConnection con = (HttpsURLConnection) url.openConnection();%0A%0A%09%09for(int i=0;i%3C headers.length;i++)%0A%09%09%09con.setRequestProperty(headers%5Bi%5D%5B0%5D, headers%5Bi%5D%5B1%5D);%0A%09%09%0A%0A%09%09return doRequest(con);%0A%09%7D%0A%09/**%0A%09 * %0A%09 * @param headers  parejas de valores a insertar en la peticion%0A%09 * @param params String con la informacion en la url%0A%09 * @return String con la informacion%0A%09 * @throws Exception%0A%09 */%0A%09public String sendPost(String%5B%5D%5B%5D headers, String params) throws Exception %7B%0A%0A%09%09HttpsURLConnection con = (HttpsURLConnection) url.openConnection();%0A%0A%09%09con.setRequestMethod(%22POST%22);%0A%09%09for(int i=0;i%3C headers.length;i++)%0A%09%09%09con.setRequestProperty(headers%5Bi%5D%5B0%5D, headers%5Bi%5D%5B1%5D);%0A%09%09%0A%09%09con.setDoOutput(true);%0A%09%09DataOutputStream wr = new DataOutputStream(con.getOutputStream());%0A%09%09wr.writeBytes(params);%0A%09%09wr.flush();%0A%09%09wr.close();%0A%0A%09%09return doRequest(con);%0A%0A%09%7D%0A%09%0A%09private String doRequest(HttpsURLConnection con) throws IOException%7B%0A%09%09%0A%09%09BufferedReader in = new BufferedReader(%0A%09%09        new InputStreamReader(con.getInputStream()));%0A%09%09String inputLine;%0A%09%09StringBuffer response = new StringBuffer();%0A%0A%09%09while ((inputLine = in.readLine()) != null) %0A%09%09%09response.append(inputLine);%0A%09%09%0A%09%09in.close();%0A%09%09%0A%09%09return response.toString();%0A%09%7D%0A%0A%7D%0A

Create HTTPRequest.java