Class VRequest

  • All Implemented Interfaces:
    Request

    public class VRequest
    extends Object
    implements Request
    An implementation of HTTP request.
    Author:
    Maksim Tkachenko, Truong Quoc Tuan, Ween Jiann Lee
    • Constructor Detail

      • VRequest

        public VRequest​(String url)
        Constructs an instance of venom request.
        Parameters:
        url - The url for this request.
      • VRequest

        public VRequest​(String url,
                        Map<String,​String> headers)
        Constructs an instance of venom request.
        Parameters:
        url - The url for this request
        headers - The headers to append for this request
      • VRequest

        protected VRequest​(VRequest.Builder<?> builder)
        Constructs an instance of venom request.
        Parameters:
        builder - An instance of builder
    • Method Detail

      • build

        public static VRequest.Builder build​(Request.Method method,
                                             String url)
        Create a new instance of builder with a method and url.
        Parameters:
        method - Request method
        url - Request url
        Returns:
        A new instance of builder
      • getMethod

        public final Request.Method getMethod()
        Description copied from interface: Request
        Returns the method type of the request.
        Specified by:
        getMethod in interface Request
        Returns:
        method type
      • getBody

        public final String getBody()
        Description copied from interface: Request
        Returns the request body of the request or null if none specified.
        Specified by:
        getBody in interface Request
        Returns:
        request body
      • getUrl

        public final String getUrl()
        Description copied from interface: Request
        Returns the url of the request.
        Specified by:
        getUrl in interface Request
        Returns:
        url
      • getHeaders

        public final Map<String,​String> getHeaders()
        Description copied from interface: Request
        Returns the headers set for the request.
        Specified by:
        getHeaders in interface Request
        Returns:
        a map of the headers set
      • getProxy

        public final org.apache.http.HttpHost getProxy()
        Description copied from interface: Request
        Returns the proxy set to be used for the request or default to fetcher if none specified.
        Specified by:
        getProxy in interface Request
        Returns:
        proxy
      • getSleepScheduler

        public final SleepScheduler getSleepScheduler()
        Description copied from interface: Request
        Returns information about the amount of sleep before this request is made.
        Specified by:
        getSleepScheduler in interface Request
        Returns:
        an instance of SleepScheduler