Method: PulpContainerClient::ApiClient#build_request
- Defined in:
- lib/pulp_container_client/api_client.rb
#build_request(http_method, path, request, opts = {}) ⇒ Faraday::Request
Builds the HTTP request
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/pulp_container_client/api_client.rb', line 102 def build_request(http_method, path, request, opts = {}) url = build_request_url(path, opts) http_method = http_method.to_sym.downcase header_params = @default_headers.merge(opts[:header_params] || {}) query_params = opts[:query_params] || {} form_params = opts[:form_params] || {} update_params_for_auth! header_params, query_params, opts[:auth_names] if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) if config.debugging config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" end end request.headers = header_params request.body = req_body # Overload default options only if provided request..params_encoder = config.params_encoder if config.params_encoder request..timeout = config.timeout if config.timeout request.url url request.params = query_params request end |