public class ODataRequest extends Object
| Constructor and Description |
|---|
ODataRequest() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String name,
List<String> values)
Adds a header to the request.
|
void |
addHeader(String name,
String value)
Adds a header to the request.
|
Map<String,List<String>> |
getAllHeaders()
Gets all headers.
|
InputStream |
getBody()
Gets the body of the request.
|
String |
getHeader(String name)
Gets first header value for a given name.
|
List<String> |
getHeaders(String name)
Gets header values for a given name.
|
HttpMethod |
getMethod()
Gets the HTTP method.
|
String |
getProtocol() |
String |
getRawBaseUri()
Gets the base URI.
|
String |
getRawODataPath()
Gets the path segments of the request URI that belong to OData.
|
String |
getRawQueryPath()
Gets the query part of the request URI.
|
String |
getRawRequestUri()
Gets the total request URI.
|
String |
getRawServiceResolutionUri()
Gets the URI part responsible for service resolution.
|
void |
setBody(InputStream body)
Sets the body of the request.
|
void |
setHeader(String name,
String value)
Sets a header in the request.
|
void |
setMethod(HttpMethod method)
Sets the HTTP method.
|
void |
setProtocol(String protocol)
Sets the HTTP protocol used
|
void |
setRawBaseUri(String rawBaseUri)
Sets the base URI.
|
void |
setRawODataPath(String rawODataPath)
Sets the path segments of the request URI that belong to OData.
|
void |
setRawQueryPath(String rawQueryPath)
Sets the query part of the request URI.
|
void |
setRawRequestUri(String rawRequestUri)
Sets the total request URI.
|
void |
setRawServiceResolutionUri(String rawServiceResolutionUri)
Sets the URI part responsible for service resolution.
|
public HttpMethod getMethod()
public void setMethod(HttpMethod method)
method - the HTTP method (GET, PUT, POST ...)public void setHeader(String name, String value)
Sets a header in the request.
The header name will be handled as case-insensitive key.
If a header already exists then the header will be replaced by this new value.
name - case-insensitive header namevalue - value for the given header namepublic void addHeader(String name, String value)
Adds a header to the request.
The header name will be handled as case-insensitive key.
If a header already exists then the list of values will just be extended.
name - case-insensitive header namevalue - value for the given header namepublic void addHeader(String name, List<String> values)
Adds a header to the request.
The header name will be handled as case-insensitive key.
If a header already exists then the list of values will just be extended.
name - case-insensitive header namevalues - list of values for the given header namepublic List<String> getHeaders(String name)
name - the header name as a case-insensitive keypublic String getHeader(String name)
name - the header name as a case-insensitive keypublic Map<String,List<String>> getAllHeaders()
public InputStream getBody()
InputStream or nullpublic void setBody(InputStream body)
body - the request payload as InputStreampublic String getRawQueryPath()
$format=json,$top=10"public void setRawQueryPath(String rawQueryPath)
getRawQueryPath()public String getRawBaseUri()
http://localhost/my%20service"public void setRawBaseUri(String rawBaseUri)
getRawBaseUri()public String getRawRequestUri()
http://localhost/my%20service/sys1/Employees?$format=json"public void setRawRequestUri(String rawRequestUri)
getRawRequestUri()public String getRawODataPath()
public void setRawODataPath(String rawODataPath)
getRawODataPath()public String getRawServiceResolutionUri()
sys1"public void setRawServiceResolutionUri(String rawServiceResolutionUri)
getRawServiceResolutionUri()public String getProtocol()
public void setProtocol(String protocol)
protocol - getProtocol()Copyright © 2013–2023 The Apache Software Foundation. All rights reserved.