Last Updated: February 25, 2016
· nick-desteffen

Proper Typhoeus PUT request

Submitting a PUT request with Typhoeus is a bit different than a POST request. You need to explicitly set the content-type header in order for the parameters specified in the body to be properly parsed by Rails

parameters = {user: {email: '', name: 'Example User'}}
headers = {"content-type" => "application/x-www-form-urlencoded"}

Typhoeus::Request.put("", body: parameters, headers: headers)

1 Response
Add your response


Thank you very much, you saved the other half of my day.

over 1 year ago ·