0
Ich verwende RestClient Juwel, unter meinem Befehl istRuby-POST-Anfrage mit Grunde Auth und mehrere Daten
curl -H 'Authorization: Basic ENCODED_CLIENT_CREDENTIALS' --data '[email protected]&password=test&grant_type=password&scope=user%20documents%20user%2Fdocumentsv2' https://api.com/oauth2/token
Ich bin nicht dazu weiter unten über RestClient
übersetzen ist mein Code:
access = RestClient::Request.new(
:method => :post,
:url => 'https://api.com/oauth2/token',
:data => {
:username => 'xxxx',
:password => 'xxxx',
:grant_type => 'password'
},
:headers => {
:Authorization => "Basic some_string",
:'Content-Type' => 'application/x-www-form-urlencoded'
}
)
Zeigt 400 ungültige Anfrage an. Kann jemand für diese Übersetzung helfen.
Dank