其他分享
首页 > 其他分享> > Robotframework接口测试--RequestsLibrary库的API介绍

Robotframework接口测试--RequestsLibrary库的API介绍

作者:互联网

Create Session:创建一个session,连接某个服务器

Arguments:[ alias | url | headers=headers | cookies=cookies | auth=auth | timeout=timeout | proxies=proxies | verify=verify | debug=debug | max_retries=max_retries | backoff_factor=backoff_factor | disable_warnings=disable_warnings ]

Get Request:通过GET方式发起请求。

Post Request:通过POST方式发起请求。

TO Json: 将文本转换成json对象。

Head Request:发送一个HEAD请求。

Option Request:    发送一个Option 请求。

Patch Request:     发送一个Patch 请求。 

Put Request:         发送一个Put 请求。 

Delete Request: 向会话中发出删除请求

Delete All Sessions:   删除所有会话

Update Session:    更新会话

1.Name:Create Client Cert Session

Arguments:[ alias | url | headers=headers | cookies=cookies | client_certs=client_certs | timeout=timeout | proxies=proxies | verify=verify | debug=debug | max_retries=max_retries | backoff_factor=backoff_factor | disable_warnings=disable_warnings ]

Create Session: create a HTTP session to a server 

创建客户端证书的session

2.Name:Create Custom Session

Arguments: [alias | url | auth | headers=headers | cookies=cookies | timeout=timeout | proxies=proxies | verify=verify | debug=debug | max_retries=max_retries | backoff_factor=backoff_factor | disable_warnings=disable_warnings

创建一个定制的session

3.Name:Create Ntlm Session

也是创建一个session,只不过加上了域、用户名、密码用于NTLM认证。

Arguments: [alias | url | auth | headers=headers | cookies=cookies | timeout=timeout | proxies=proxies | verify=verify | debug=debug | max_retries=max_retries | backoff_factor=backoff_factor | disable_warnings=disable_warnings ]

4.Name:Delete

Arguments:[ alias | uri | data=data | headers=headers | allow_redirects=allow_redirects | timeout=timeout ]

Send a DELETE request on the session object found using the given `alias` 

向会话中发出删除请求

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

待办:该库的应用实例

标签:retries,cookies,RequestsLibrary,Robotframework,headers,API,timeout,factor,debug
来源: https://www.cnblogs.com/ww-xiaowei/p/10338365.html