|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.http.LowLevelHttpRequest
com.google.api.client.testing.http.MockLowLevelHttpRequest
public class MockLowLevelHttpRequest
Mock for LowLevelHttpRequest
.
Implementation is not thread-safe.
Constructor Summary | |
---|---|
MockLowLevelHttpRequest()
|
|
MockLowLevelHttpRequest(String url)
|
Method Summary | |
---|---|
void |
addHeader(String name,
String value)
Adds a header to the HTTP request. |
LowLevelHttpResponse |
execute()
Executes the request and returns a low-level HTTP response object. |
HttpContent |
getContent()
Returns the HTTP content or null for none. |
Map<String,List<String>> |
getHeaders()
Returns the map of header name to values. |
String |
getUrl()
Returns the request URL or null for none. |
void |
setContent(HttpContent content)
Sets the HTTP request content. |
MockLowLevelHttpRequest |
setUrl(String url)
Sets the request URL or null for none. |
Methods inherited from class com.google.api.client.http.LowLevelHttpRequest |
---|
setTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockLowLevelHttpRequest()
public MockLowLevelHttpRequest(String url)
url
- Request URL or null
for noneMethod Detail |
---|
public void addHeader(String name, String value)
LowLevelHttpRequest
Note that multiple headers of the same name need to be supported, in which case
LowLevelHttpRequest.addHeader(java.lang.String, java.lang.String)
will be called for each instance of the header.
addHeader
in class LowLevelHttpRequest
name
- header namevalue
- header valuepublic LowLevelHttpResponse execute() throws IOException
LowLevelHttpRequest
execute
in class LowLevelHttpRequest
IOException
public void setContent(HttpContent content) throws IOException
LowLevelHttpRequest
setContent
in class LowLevelHttpRequest
IOException
- I/O exceptionpublic String getUrl()
null
for none.
public Map<String,List<String>> getHeaders()
public MockLowLevelHttpRequest setUrl(String url)
null
for none.
public HttpContent getContent()
null
for none.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |