Sha256: 2dd857dd8ee38dcc900df8666b786a9e4f92ad2c6da571f2e5d49117dc78eec6
Contents?: true
Size: 1.04 KB
Versions: 39
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true module Aws module CloudSearchDomain module Plugins # CloudSearchDomain has query length limits for #search in GET # Convert #search operation request from GET to POST class SwitchToPost < Seahorse::Client::Plugin # @api private class Handler < Seahorse::Client::Handler def call(context) convert_get_2_post(context) @handler.call(context) end private def convert_get_2_post(context) context.http_request.http_method = 'POST' uri = context.http_request.endpoint context.http_request.body = uri.query context.http_request.headers['Content-Length'] = uri.query.length context.http_request.headers['Content-Type'] = 'application/x-www-form-urlencoded' context.http_request.endpoint.query = nil end end handler( Handler, step: :build, operations: [:search] ) end end end end
Version data entries
39 entries across 39 versions & 1 rubygems