Class HttpRequest.Builder

  • Enclosing class:

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

      • Builder

        public Builder()
      • Builder

        public Builder​(@NonNull
                       HttpRequest copy)
    • Method Detail

      • url

        public HttpRequest.Builder url​(@NonNull
                                       java.lang.String relativeUrl)
        Set the relative url to send the request
      • bodyJson

        public HttpRequest.Builder bodyJson​(@NonNull
                                            java.lang.String body)
        Set the JSON body of the request
      • body

        public HttpRequest.Builder body​(@NonNull
                                        java.lang.String body,
                                        java.lang.String contentType)
        Set a custom body with the specified content type
      • requestParams

        public HttpRequest.Builder requestParams​(@NonNull
                                                 java.util.Map<java.lang.String,​java.lang.Object> requestParams)
        Set request params
      • customHeaders

        public HttpRequest.Builder customHeaders​(@NonNull
                                                 java.util.Map<java.lang.String,​java.lang.String> customHeaders)
        Set custom headers of the request
      • options

        public HttpRequest.Builder options​(@NonNull
                                           java.util.Map<java.lang.String,​java.lang.Object> options)
        Set custom options. See HttpOption
      • responseDestinationFile

        public HttpRequest.Builder responseDestinationFile​(@NonNull
        Set the file where the response will be writen
        file -
      • callback

        public HttpRequest.Builder callback​(@NonNull
                                            Handler<? super> callback)
        Set the callback where you will be notified when the requests completes successfully or with an error.