我尝试在使用OAUTH2身份验证的应用程序接口上使用RequestsLibrary,但每次它都抛出400!=200。
Get authToken
Create Session test http://brentertainment.com/oauth2/
${data}= Create Dictionary grant_type= 'password' client_id=demoapp client_secret=demopass username= 'demouser' password='testpass'
${headers}= Create Dictionary Content-Type= 'application/x-www-form-urlencoded'
${resp}= post request test /lockdin/token ${headers} ${data}
Should Be Equal As Strings ${resp.status_code} 200
任何帮助都将不胜感激。
发布于 2017-12-27 01:19:35
我使用扩展请求库,而不是请求库
*** Settings ***
Library ExtendedRequestsLibrary
*** Test Cases ***
Post Request With Password
Create Password OAuth2 Session member http://token client_id client_secret username password scope base_url
${var} = get request member /abc
Log ${var.content}
https://stackoverflow.com/questions/47915452
复制相似问题