public class HttpRequest extends Object implements AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close() |
static int |
execute(User user,
org.apache.commons.httpclient.HttpMethod method)
Executes the provided request.
|
static HttpRequest |
get(User user,
String url)
Executes a GET on the provided URL.
|
String |
getResponseBody() |
InputStream |
getResponseBodyAsStream() |
String |
getResponseHeader(String headerName) |
int |
getStatusCode() |
public static int execute(User user, org.apache.commons.httpclient.HttpMethod method) throws IOException
IOException
- as documented by HttpClient.executeMethod(HttpMethod)
public static HttpRequest get(User user, String url)
RuntimeException
- if any problem occurs with the request, where the cause
is any exception thrown by HttpClient.executeMethod(HttpMethod)
public int getStatusCode()
public InputStream getResponseBodyAsStream() throws IOException
IOException
public String getResponseBody() throws IOException
IOException
public void close()
close
in interface AutoCloseable
Copyright © 2003–2020 Atlassian. All rights reserved.