Package net.lenni0451.commons.httpclient
Interface HttpRequestBuilder
-
- All Known Implementing Classes:
HttpClient
public interface HttpRequestBuilder
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default HttpContentRequestcontentRequest(java.lang.String method, java.lang.String url)Create a new request with the given method and url.
This request will send content to the server if specified.default HttpContentRequestcontentRequest(java.lang.String method, java.net.URL url)Create a new request with the given method and url.
This request will send content to the server if specified.default DeleteRequestdelete(java.lang.String url)Create a new DELETE request with the given url.default DeleteRequestdelete(java.net.URL url)Create a new DELETE request with the given url.default GetRequestget(java.lang.String url)Create a new GET request with the given url.default GetRequestget(java.net.URL url)Create a new GET request with the given url.default HeadRequesthead(java.lang.String url)Create a new HEAD request with the given url.default HeadRequesthead(java.net.URL url)Create a new HEAD request with the given url.default PostRequestpost(java.lang.String url)Create a new POST request with the given url.default PostRequestpost(java.net.URL url)Create a new POST request with the given url.default PutRequestput(java.lang.String url)Create a new PUT request with the given url.default PutRequestput(java.net.URL url)Create a new PUT request with the given url.default HttpRequestrequest(java.lang.String method, java.lang.String url)Create a new request with the given method and url.default HttpRequestrequest(java.lang.String method, java.net.URL url)Create a new request with the given method and url.
-
-
-
Method Detail
-
get
default GetRequest get(java.lang.String url) throws java.net.MalformedURLException
Create a new GET request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
- Throws:
java.net.MalformedURLException- If the url is invalid
-
get
default GetRequest get(java.net.URL url)
Create a new GET request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
-
head
default HeadRequest head(java.lang.String url) throws java.net.MalformedURLException
Create a new HEAD request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
- Throws:
java.net.MalformedURLException- If the url is invalid
-
head
default HeadRequest head(java.net.URL url)
Create a new HEAD request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
-
delete
default DeleteRequest delete(java.lang.String url) throws java.net.MalformedURLException
Create a new DELETE request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
- Throws:
java.net.MalformedURLException- If the url is invalid
-
delete
default DeleteRequest delete(java.net.URL url)
Create a new DELETE request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
-
post
default PostRequest post(java.lang.String url) throws java.net.MalformedURLException
Create a new POST request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
- Throws:
java.net.MalformedURLException- If the url is invalid
-
post
default PostRequest post(java.net.URL url)
Create a new POST request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
-
put
default PutRequest put(java.lang.String url) throws java.net.MalformedURLException
Create a new PUT request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
- Throws:
java.net.MalformedURLException- If the url is invalid
-
put
default PutRequest put(java.net.URL url)
Create a new PUT request with the given url.- Parameters:
url- The url to send the request to- Returns:
- The created request
-
request
default HttpRequest request(java.lang.String method, java.lang.String url) throws java.net.MalformedURLException
Create a new request with the given method and url.- Parameters:
method- The method to useurl- The url to send the request to- Returns:
- The created request
- Throws:
java.net.MalformedURLException- If the url is invalid
-
request
default HttpRequest request(java.lang.String method, java.net.URL url)
Create a new request with the given method and url.- Parameters:
method- The method to useurl- The url to send the request to- Returns:
- The created request
-
contentRequest
default HttpContentRequest contentRequest(java.lang.String method, java.lang.String url) throws java.net.MalformedURLException
Create a new request with the given method and url.
This request will send content to the server if specified.- Parameters:
method- The method to useurl- The url to send the request to- Returns:
- The created request
- Throws:
java.net.MalformedURLException- If the url is invalid
-
contentRequest
default HttpContentRequest contentRequest(java.lang.String method, java.net.URL url)
Create a new request with the given method and url.
This request will send content to the server if specified.- Parameters:
method- The method to useurl- The url to send the request to- Returns:
- The created request
-
-