|
||||||||||
| 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.
| Field Summary | |
|---|---|
HttpContent |
content
Deprecated. (scheduled to be made private in 1.6) Use getContent() or
setContent(com.google.api.client.http.HttpContent) |
com.google.common.collect.ListMultimap<String,String> |
headers
Deprecated. (scheduled to be removed in 1.6) Use getHeaders() or getHeaders() |
String |
url
Deprecated. (scheduled to be made private in 1.6) Use getUrl() or setUrl(java.lang.String) |
| 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 |
| Field Detail |
|---|
@Deprecated public String url
getUrl() or setUrl(java.lang.String)null for none.
@Deprecated public final com.google.common.collect.ListMultimap<String,String> headers
getHeaders() or getHeaders()addHeader(String, String).
@Deprecated public HttpContent content
getContent() or
setContent(com.google.api.client.http.HttpContent)null for none.
| Constructor Detail |
|---|
public MockLowLevelHttpRequest()
public MockLowLevelHttpRequest(String url)
url - Request URL or null for none| Method 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 LowLevelHttpRequestname - header namevalue - header value
public LowLevelHttpResponse execute()
throws IOException
LowLevelHttpRequest
execute in class LowLevelHttpRequestIOException
public void setContent(HttpContent content)
throws IOException
LowLevelHttpRequest
setContent in class LowLevelHttpRequestIOException - 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 | |||||||||