Search This Blog
Showing posts with label Headers. Show all posts
Showing posts with label Headers. Show all posts
Thursday, March 19, 2020
How to add WGET http headers Authorization
Thursday, March 15, 2018
Ruby Rails Rest-Client with POST Parameters, Authorization, Headers
response = RestClient::Request.new({
method: :post,
url: 'https://infovijay.com,
user: 'vijay',
password: 'dr12345',
payload: { key1: 'value1', key2: 'value2' },
headers: { :accept => :json, content_type: :json }
}).execute do |response, request, result|
case response.code
when 400
[ :error, parse_json(response.to_str) ]
when 200
[ :success, parse_json(response.to_str) ]
else
fail "#{response.to_str}."
end
end
method: :post,
url: 'https://infovijay.com,
user: 'vijay',
password: 'dr12345',
payload: { key1: 'value1', key2: 'value2' },
headers: { :accept => :json, content_type: :json }
}).execute do |response, request, result|
case response.code
when 400
[ :error, parse_json(response.to_str) ]
when 200
[ :success, parse_json(response.to_str) ]
else
fail "#{response.to_str}."
end
end
Labels:
Authorization,
drvijayy2k2,
Headers,
infovijay,
java,
method,
Parameters,
POST,
Rails,
Rest-Client,
ror,
Ruby,
security
Subscribe to:
Posts (Atom)