C'est le code source de HTTPClient
:arguments de la méthode Ruby de transition
def post(uri, *args, &block)
request(:post, uri, argument_to_hash(args, :body, :header, :follow_redirect), &block)
end
J'ai fait suite emballage:
def post(uri, *args, &block)
http.post(uri, args, &block)
rescue Exception => ex
log_exception ex
end
et essayer de passer des paramètres:
httpclient.post 'url', xml_data, 'Content-Type' => 'application/xml'
my_proxy.post 'url', xml_data, 'Content-Type' => 'application/xml'
En premier cas HttpClient reçoit les arguments suivants:
[
"my xml text",
{"Content-Type"=>"application/xml"}
]
En second cas:
[
[
"my xml text",
{"Content-Type"=>"application/xml"}
]
]
Comment passer des arguments de la bonne manière?