Class Request.Builder

  • Enclosing class:
    Request

    public static final class Request.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • httpMethod

        public Request.Builder httpMethod​(java.lang.String httpMethodToSet)
        A http method (i.e. GET, POST, HEAD).
      • url

        public Request.Builder url​(java.lang.String urlToSet)
        The URL that is pointing to the wanted resource.
      • headers

        public Request.Builder headers​(@Nullable
                                       java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headersToSet)
        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

        public Request.Builder dataToSend​(byte[] dataToSendToSet)
        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).
      • automaticLocalizationHeader

        public Request.Builder automaticLocalizationHeader​(boolean automaticLocalizationHeaderToSet)
        If localization headers should automatically be included in the request.
      • post

        public Request.Builder post​(java.lang.String urlToSet,
                                    @Nullable
                                    byte[] dataToSendToSet)
      • setHeaders

        public Request.Builder setHeaders​(java.lang.String headerName,
                                          java.util.List<java.lang.String> headerValueList)
      • addHeaders

        public Request.Builder addHeaders​(java.lang.String headerName,
                                          java.util.List<java.lang.String> headerValueList)
      • setHeader

        public Request.Builder setHeader​(java.lang.String headerName,
                                         java.lang.String headerValue)
      • addHeader

        public Request.Builder addHeader​(java.lang.String headerName,
                                         java.lang.String headerValue)