-
-
Save frizop/fd3bb44650414d49fead30c4e8d86201 to your computer and use it in GitHub Desktop.
http_post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def http_post(uri, form_data, crumb) | |
key, value = crumb.split(":") | |
uri = URI(uri) | |
request = Net::HTTP::Post.new(uri) | |
request.basic_auth '', '' | |
request[key] = value | |
request.set_form form_data, 'multipart/form-data' | |
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: false) do |http| | |
http.request(request) | |
end | |
# binding.pry | |
response.body | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment