public final class HttpResponseDecorator.HeadersDecorator extends Object implements Iterable<Object>
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 and Description |
|---|
HttpResponseDecorator.HeadersDecorator() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.Header |
getAt(String name)
Access the named header value, using bracket form.
|
Iterator<Object> |
iterator()
Used to allow Groovy iteration methods over the response headers.
|
protected String |
propertyMissing(String name)
Allow property-style access to header values.
|
public HttpResponseDecorator.HeadersDecorator()
public org.apache.http.Header getAt(String name)
response.headers['Content-Encoding']name - header name, e.g. Content-TypeHeader, or null if it does not exist
in this responseHttpMessage.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-TypeHeader, or null if it does not exist
in this responseCopyright © 2010–2014. All rights reserved.