mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1142 from grkvlt/accept-headers-openstack
Add Accept header with application/json media type to OpenStack requests
This commit is contained in:
commit
794f1159a2
5 changed files with 5 additions and 0 deletions
lib/fog
|
@ -114,6 +114,7 @@ module Fog
|
||||||
"#{uri.scheme}://#{uri.host}:#{uri.port}/v2.0/tenants", false, connection_options).request({
|
"#{uri.scheme}://#{uri.host}:#{uri.port}/v2.0/tenants", false, connection_options).request({
|
||||||
:expects => [200, 204],
|
:expects => [200, 204],
|
||||||
:headers => {'Content-Type' => 'application/json',
|
:headers => {'Content-Type' => 'application/json',
|
||||||
|
'Accept' => 'application/json',
|
||||||
'X-Auth-Token' => body['access']['token']['id']},
|
'X-Auth-Token' => body['access']['token']['id']},
|
||||||
:host => uri.host,
|
:host => uri.host,
|
||||||
:method => 'GET'
|
:method => 'GET'
|
||||||
|
|
|
@ -300,6 +300,7 @@ module Fog
|
||||||
response = @connection.request(params.merge({
|
response = @connection.request(params.merge({
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
|
'Accept' => 'application/json',
|
||||||
'X-Auth-Token' => @auth_token
|
'X-Auth-Token' => @auth_token
|
||||||
}.merge!(params[:headers] || {}),
|
}.merge!(params[:headers] || {}),
|
||||||
:host => @host,
|
:host => @host,
|
||||||
|
|
|
@ -203,6 +203,7 @@ module Fog
|
||||||
response = @connection.request(params.merge({
|
response = @connection.request(params.merge({
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
|
'Accept' => 'application/json',
|
||||||
'X-Auth-Token' => @auth_token
|
'X-Auth-Token' => @auth_token
|
||||||
}.merge!(params[:headers] || {}),
|
}.merge!(params[:headers] || {}),
|
||||||
:host => @host,
|
:host => @host,
|
||||||
|
|
|
@ -6,6 +6,7 @@ module Fog
|
||||||
response = @identity_connection.request({
|
response = @identity_connection.request({
|
||||||
:expects => [200, 204],
|
:expects => [200, 204],
|
||||||
:headers => {'Content-Type' => 'application/json',
|
:headers => {'Content-Type' => 'application/json',
|
||||||
|
'Accept' => 'application/json',
|
||||||
'X-Auth-Token' => @auth_token},
|
'X-Auth-Token' => @auth_token},
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => '/v2.0/tenants'
|
:path => '/v2.0/tenants'
|
||||||
|
|
|
@ -142,6 +142,7 @@ module Fog
|
||||||
response = @connection.request(params.merge({
|
response = @connection.request(params.merge({
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
|
'Accept' => 'application/json',
|
||||||
'X-Auth-Token' => @auth_token
|
'X-Auth-Token' => @auth_token
|
||||||
}.merge!(params[:headers] || {}),
|
}.merge!(params[:headers] || {}),
|
||||||
:host => @host,
|
:host => @host,
|
||||||
|
|
Loading…
Add table
Reference in a new issue