Add `Authorization Bearer` hash to Net::HTTP post request (Ruby)
问题 How can I add Authorization Bearer to a POST request with Net::HTTP ? I can only find help for "basic authentication" in the documentation. req.basic_auth 'user', 'pass' Source: https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html#class-Net::HTTP-label-Basic+Authentication I'm trying to replicate a curl that would look like: > curl 'http://localhost:8080/places' -d '{"_json":[{"uuid":"0514b...", > "name":"Athens"}]}' -X POST -H 'Content-Type: application/json' -H > 'Authorization: Bearer