Class Request
- java.lang.Object
-
- org.schabi.newpipe.extractor.downloader.Request
-
public class Request extends java.lang.ObjectAn object that holds request information used whenexecutinga request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRequest.Builder
-
Constructor Summary
Constructors Constructor Description Request(java.lang.String httpMethod, java.lang.String url, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers, byte[] dataToSend, Localization localization, boolean automaticLocalizationHeader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]dataToSend()An optional byte array that will be sent when doing the request, very commonly used inPOSTrequests.
The implementation should make note of some recommended headers (for example,Content-Lengthin a post request).booleanequals(java.lang.Object o)static java.util.Map<java.lang.String,java.util.List<java.lang.String>>getHeadersFromLocalization(Localization localization)inthashCode()java.util.Map<java.lang.String,java.util.List<java.lang.String>>headers()A list of headers that will be used in the request.
Any default headers that the implementation may have, should be overridden by these.java.lang.StringhttpMethod()A http method (i.e.Localizationlocalization()A localization object that should be used when executing a request.
Usually theAccept-Languagewill be set to this value (a helper method to do this easily:getHeadersFromLocalization(Localization)).static Request.BuildernewBuilder()java.lang.Stringurl()The URL that is pointing to the wanted resource.
-
-
-
Constructor Detail
-
Request
public Request(java.lang.String httpMethod, java.lang.String url, @Nullable java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers, @Nullable byte[] dataToSend, @Nullable Localization localization, boolean automaticLocalizationHeader)
-
-
Method Detail
-
httpMethod
public java.lang.String httpMethod()
A http method (i.e.GET, POST, HEAD).
-
url
public java.lang.String url()
The URL that is pointing to the wanted resource.
-
headers
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers()
A list of headers that will be used in the request.
Any default headers that the implementation may have, should be overridden by these.
-
dataToSend
@Nullable public byte[] dataToSend()
An optional byte array that will be sent when doing the request, very commonly used inPOSTrequests.
The implementation should make note of some recommended headers (for example,Content-Lengthin a post request).
-
localization
@Nullable public Localization localization()
A localization object that should be used when executing a request.
Usually theAccept-Languagewill be set to this value (a helper method to do this easily:getHeadersFromLocalization(Localization)).
-
newBuilder
public static Request.Builder newBuilder()
-
getHeadersFromLocalization
@Nonnull public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeadersFromLocalization(@Nullable Localization localization)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-