|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jayway.restassured.internal.http.HttpResponseDecorator.HeadersDecorator
public final class HttpResponseDecorator.HeadersDecorator
This class is returned by HttpResponseDecorator.getHeaders().
It provides three "Groovy" ways to access headers:
resp.headers['Content-Type']
returns the Header instanceresp.headers.'Content-Type'
returns the header valueresp.headers.each {
println "${it.name} : ${it.value}"
}
| Constructor Summary | |
|---|---|
HttpResponseDecorator.HeadersDecorator()
|
|
| Method Summary | |
|---|---|
org.apache.http.Header |
getAt(String name)
Access the named header value, using bracket form. |
Iterator<org.apache.http.Header> |
iterator()
Used to allow Groovy iteration methods over the response headers. |
protected String |
propertyMissing(String name)
Allow property-style access to header values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpResponseDecorator.HeadersDecorator()
| Method Detail |
|---|
public org.apache.http.Header getAt(String name)
response.headers['Content-Encoding']
name - header name, e.g. Content-Type
- Returns:
- the
Header, or null if it does not exist
in this response - See Also:
HttpMessage.getFirstHeader(String)protected String propertyMissing(String name)
getAt(String), except it simply returns the header's String
value, instead of the Header object.
name - header name, e.g. Content-Type
- Returns:
- the
Header, or null if it does not exist
in this response public Iterator<org.apache.http.Header> iterator()
response.headers.each {
println "${it.name} : ${it.value}"
}
iterator in interface Iterable<org.apache.http.Header>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||