RF接口測試----post請求


 

注意:

RF的post請求中必須帶headers(消息頭),否則會報參數為空。

 

代碼:

*** Settings ***
Library    RequestsLibrary    


*** Test Cases ***    
聚合數據----天氣預報查詢--post請求
    Create Session    weathersearch    http://apis.juhe.cn   
    &{params}=  Create Dictionary    city=上海   key=e3cf8a6c0b....2c45df6ae409679   
    &{headers}=  Create Dictionary    Content-Type=application/x-www-form-urlencoded  
    Log    ${params}    
    ${response}=  Post Request    weathersearch    /simpleWeather/query  params=${params}   
    Log    ${response.text}
    Log    ${response.status_code} 

  

運行結果:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM