java.lang.Object
org.schabi.newpipe.extractor.downloader.Request

public class Request extends Object
An object that holds request information used when executing a request.
  • Constructor Details

  • Method Details

    • httpMethod

      public String httpMethod()
      A http method (i.e. GET, POST, HEAD).
    • url

      public String url()
      The URL that is pointing to the wanted resource.
    • headers

      public Map<String,List<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 in POST requests.

      The implementation should make note of some recommended headers (for example, Content-Length in a post request).
    • localization

      @Nullable public Localization localization()
      A localization object that should be used when executing a request.

      Usually the Accept-Language will be set to this value (a helper method to do this easily: getHeadersFromLocalization(Localization)).
    • newBuilder

      public static Request.Builder newBuilder()
    • getHeadersFromLocalization

      @Nonnull public static Map<String,List<String>> getHeadersFromLocalization(@Nullable Localization localization)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object