Class HttpRequest
- java.lang.Object
-
- com.mongodb.stitch.core.services.http.HttpRequest
-
public final class HttpRequest extends Object
An HttpRequest encapsulates the details of an HTTP request over the HTTP service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpRequest.Builder
A builder that can buildHttpRequest
s.
-
Method Summary
Modifier and Type Method Description String
getAuthUrl()
Returns the URL that will be used to capture cookies for authentication before the actual request is executed.Object
getBody()
Returns the body that will be included in the request.Map<String,String>
getCookies()
Returns the cookies that will be included in the request.Boolean
getEncodeBodyAsJson()
Returns whether or not the included body should be encoded as extended JSON when sent to the url in this request.Boolean
getFollowRedirects()
Returns whether or not Stitch should follow redirects while executing the request.Map<String,String>
getForm()
Returns the form that will be included in the request.Map<String,Collection<String>>
getHeaders()
Returns the headers that will be included in the request.HttpMethod
getMethod()
Returns the HTTP method of the request.String
getUrl()
Returns the URL that the request will be performed against.
-
-
-
Method Detail
-
getUrl
public String getUrl()
Returns the URL that the request will be performed against.- Returns:
- the URL that the request will be performed against.
-
getMethod
public HttpMethod getMethod()
Returns the HTTP method of the request.- Returns:
- the HTTP method of the request.
-
getAuthUrl
public String getAuthUrl()
Returns the URL that will be used to capture cookies for authentication before the actual request is executed.- Returns:
- the URL that will be used to capture cookies for authentication before the actual request is executed.
-
getHeaders
public Map<String,Collection<String>> getHeaders()
Returns the headers that will be included in the request.- Returns:
- the headers that will be included in the request.
-
getCookies
public Map<String,String> getCookies()
Returns the cookies that will be included in the request.- Returns:
- the cookies that will be included in the request.
-
getBody
public Object getBody()
Returns the body that will be included in the request.- Returns:
- the body that will be included in the request.
-
getEncodeBodyAsJson
public Boolean getEncodeBodyAsJson()
Returns whether or not the included body should be encoded as extended JSON when sent to the url in this request.- Returns:
- whether or not the included body should be encoded as extended JSON when sent to the url in this request.
-
getForm
public Map<String,String> getForm()
Returns the form that will be included in the request.- Returns:
- the form that will be included in the request.
-
getFollowRedirects
public Boolean getFollowRedirects()
Returns whether or not Stitch should follow redirects while executing the request. Defaults to false.- Returns:
- whether or not Stitch should follow redirects while executing the request. Defaults to false.
-
-