1

我想发送一个请求而不编码参数。因为我的 API 期望参数为 auth_token,但在发送请求时它被编码为 auth%5Ftoken。因此,它的抛出错误。请帮我发送不带编码的请求。我正在使用健身房 Typhoeus 发送 http 请求。

我的代码:

 data = {"auth_token"=>"abcd" ,"employee" => {"method" => "add_employee"}}
 header =  { "Content-Type" => "application/json","Accept"=>"application/json"}
 request = Typhoeus::Request.post("www.example.com",:body=> data.to_json,:headers => header)
4

0 回答 0