0
我使用RESTClient实现创业板,下面是我的命令红宝石POST请求使用基本身份验证和多个数据
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
我不要通过以下RestClient
翻译,这是我的代码:
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'
}
)
显示400个不良要求。 任何人都可以为此翻译提供帮助。
感谢