Created
December 14, 2018 10:49
-
-
Save MelloHey/e18dfa14021774665922cf7a73169a39 to your computer and use it in GitHub Desktop.
curl to ruby
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
curl -X POST https://mydomain.com/attachments -H 'authorization: Got this’ -F "readme=@README.md" | |
---------------------------------------------------------------------------------------------------------------- | |
uri = URI.parse("https://mydomain.com/attachments") | |
request = Net::HTTP::Post.new(uri) | |
req_headers | |
request["Authorization"] = req_headers | |
req_options = { | |
use_ssl: uri.scheme == "https", | |
} | |
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http| | |
http.request(request) | |
end | |
byebug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment