Package software.amazon.awssdk.crt.http
Class HttpRequest
- java.lang.Object
-
- software.amazon.awssdk.crt.http.HttpRequest
-
public class HttpRequest extends Object
Represents a single Client Request to be sent on a HTTP connection
-
-
Constructor Summary
Constructors Constructor Description HttpRequest(String method, String encodedPath)
HttpRequest(String method, String encodedPath, HttpHeader[] headers, HttpRequestBodyStream bodyStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeader(String headerName, String headerValue)
void
addHeader(HttpHeader header)
void
addHeaders(HttpHeader[] headers)
HttpRequestBodyStream
getBodyStream()
String
getEncodedPath()
List<HttpHeader>
getHeaders()
HttpHeader[]
getHeadersAsArray()
String
getMethod()
byte[]
marshalForJni()
Requests are marshalled as follows: each string field is: [4-bytes BE] [variable length bytes specified by the previous field] Each request is then: [method][path][header name-value pairs]void
setEncodedPath(String encodedPath)
-
-
-
Constructor Detail
-
HttpRequest
public HttpRequest(String method, String encodedPath)
- Parameters:
method
- http verb to useencodedPath
- path of the http request
-
HttpRequest
public HttpRequest(String method, String encodedPath, HttpHeader[] headers, HttpRequestBodyStream bodyStream)
- Parameters:
method
- http verb to useencodedPath
- path of the http requestheaders
- set of http request headers to includebodyStream
- (optional) interface to an object that will stream out the request body
-
-
Method Detail
-
getMethod
public String getMethod()
-
getEncodedPath
public String getEncodedPath()
-
setEncodedPath
public void setEncodedPath(String encodedPath)
-
getHeaders
public List<HttpHeader> getHeaders()
-
getHeadersAsArray
public HttpHeader[] getHeadersAsArray()
-
addHeader
public void addHeader(HttpHeader header)
-
addHeaders
public void addHeaders(HttpHeader[] headers)
-
getBodyStream
public HttpRequestBodyStream getBodyStream()
-
marshalForJni
public byte[] marshalForJni()
Requests are marshalled as follows: each string field is: [4-bytes BE] [variable length bytes specified by the previous field] Each request is then: [method][path][header name-value pairs]- Returns:
- encoded blob of headers
-
-