Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/main/java/cc/protea/util/http/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.lang.reflect.Modifier;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -66,6 +67,25 @@ public Request(final String url) {
}
}

/**
* The Constructor takes the url as a String and a proxy as a Proxy.
*
* @param url
* The url parameter does not need the query string parameters if they are going to be supplied via calls to
* {@link #addQueryParameter(String, String)}. You can, however, supply the query parameters in the URL if you wish.
* @param proxy
* The Connection's Proxy value
*
*/
public Request(final String url, final Proxy proxy) {
try {
this.url = new URL(url);
this.connection = (HttpURLConnection) this.url.openConnection(proxy);
} catch (IOException e) {
throw new RuntimeException(e);
}
}

/**
* Adds a Query Parameter to a list. The list is converted to a String and appended to the URL when the Request is submitted.
*
Expand Down