robot framework——httplibrary.http接口自动化库 ——get关键字——发送一个http协议中常见的get请求

在使用create  http  context关键字创建了http的调用环境后,即可以使用get关键字发送一个http协议中常见的get请求了。

 

get关键字只接收一个url参数。该关键字的API中,对url的原始描述是:‘url’ is the url relative to the server root.

 

=================================================================================================

 

示例(一)、使用get请求,访问百度主页 :

 

create  http  context host=www.baidu.com:80 scheme=http
get /  

 

 

 

示例(二)、使用get请求,访问robot  framework主页下的examples:

 

create  http  context robotframework.org scheme=http
get /#examples  

 

 

 

示例(三)、使用get请求,访问一个带有传入参数的示例:

 

create  http  context sp0.baidu.com scheme=https
get

/s?wd=soapui&pn=10&oq=soapui&tn=50000021_hao_pg&ie=utf-8&rsv_pq=cafd678c001751e0&rsv_t=836bNdioFKWZKH9HzbVe3xJXW7k5xDPGDfjoemGfGlnvsKFVrJPInHcKYn

%2Fz8kl%2FIz%2Fhit7V&srcqid

=3891848302898976690&rsv_page=1

 
${body} get  response  body  
log ${body}  

 

posted @ 2020-02-02 19:39  小白龙白龙马  阅读(409)  评论(0编辑  收藏  举报