2017-12-20 20 views
0

OAUTH2認証を使用しているAPIでRequestsLibraryを使用しようとしていますが、そのたびに400をスローします。 = 200。OAuth2を使用したAPI上のRequestsLibrary

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 

助けてください。

+0

代わりに要求ライブラリの拡張要求ライブラリを使用?この方法で、私たちはあなたをより良く助けることができます。 –

+0

@ A.kootstraデモのoauthサーバーでサンプルを更新しましたが、今は404を取得しています。どこが間違っているのか分かりません –

答えて

0

私はOAuthのサーバがアクセス不能であるとして、あなたは、オンラインテストのOAuthサーバーを使用するように例を変更することができます

*** 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} 
関連する問題