Commit bdd1968a by Oliver Woodman

Allow reading of response headers from HttpDataSource implementations

parent 36617264
...@@ -153,6 +153,11 @@ public class DefaultHttpDataSource implements HttpDataSource { ...@@ -153,6 +153,11 @@ public class DefaultHttpDataSource implements HttpDataSource {
} }
@Override @Override
public Map<String, List<String>> getResponseHeaders() {
return connection == null ? null : connection.getHeaderFields();
}
@Override
public void setRequestProperty(String name, String value) { public void setRequestProperty(String name, String value) {
Assertions.checkNotNull(name); Assertions.checkNotNull(name);
Assertions.checkNotNull(value); Assertions.checkNotNull(value);
......
...@@ -145,4 +145,11 @@ public interface HttpDataSource extends UriDataSource { ...@@ -145,4 +145,11 @@ public interface HttpDataSource extends UriDataSource {
*/ */
void clearAllRequestProperties(); void clearAllRequestProperties();
/**
* Gets the headers provided in the response.
*
* @return The response headers, or {@code null} if response headers are unavailable.
*/
Map<String, List<String>> getResponseHeaders();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment