Class Response
- java.lang.Object
-
- org.schabi.newpipe.extractor.downloader.Response
-
public class Response extends java.lang.ObjectA Data class used to hold the results from requests made by the Downloader implementation.
-
-
Constructor Summary
Constructors Constructor Description Response(int responseCode, java.lang.String responseMessage, java.util.Map<java.lang.String,java.util.List<java.lang.String>> responseHeaders, java.lang.String responseBody, java.lang.String latestUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHeader(java.lang.String name)For easy access to some header value that (usually) don't repeat itself.java.lang.StringlatestUrl()Used for detecting a possible redirection, limited to the latest one.java.lang.StringresponseBody()intresponseCode()java.util.Map<java.lang.String,java.util.List<java.lang.String>>responseHeaders()java.lang.StringresponseMessage()
-
-
-
Method Detail
-
responseCode
public int responseCode()
-
responseMessage
public java.lang.String responseMessage()
-
responseHeaders
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> responseHeaders()
-
responseBody
@Nonnull public java.lang.String responseBody()
-
latestUrl
@Nonnull public java.lang.String latestUrl()
Used for detecting a possible redirection, limited to the latest one.- Returns:
- latest url known right before this response object was created
-
getHeader
@Nullable public java.lang.String getHeader(java.lang.String name)
For easy access to some header value that (usually) don't repeat itself.For getting all the values associated to the header, use
responseHeaders()(e.g.Set-Cookie).- Parameters:
name- the name of the header- Returns:
- the first value assigned to this header
-
-