Rest API/ Soap UI 工具 - 如何在到达终点时手动传递 Cookie
Rest API/ Soap UI Tool - How to Pass Cookie manually while hitting the end point
我是 RESTful 服务测试的新手,在与需要传递 Cookie 的端点建立连接时遇到了问题。我有参数和值,但不确定如何在点击请求时手动传递 Cookie(不是通过 header 或 Groovy 脚本)。
只需发送 http header
Cookie: name=value
到服务器
TL;DR
就 http-request 而言,Cookie 只是一个 header,名称为 cookie
,格式为 header-value,格式为 name=value; anothername=anothervalue; yetanotherone=yetanothervalue;
继续阅读
来自https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie
The Cookie HTTP request header contains stored HTTP cookies previously
sent by the server with the Set-Cookie header.
The Cookie header is optional and may be omitted if, for example, the
browser's privacy settings block cookies.
如何发送Cookie
就像其他人一样 header。唯一的条件是,Header 名称应该是 cookie
并且 Header-value 应该是 name=value; anothername=anothervalue; yetanotherone=yetanothervalue;
格式。
卷曲
curl -v --cookie "USER_TOKEN=my-most-secure-session-id" http://localhost:8080/
如果你想让你的curl读取cookie文件并发送
使用curl -c /path/to/cookiefile http://yourhost/
更多信息:https://curl.haxx.se/docs/http-cookies.html
如何使用 SoapUI 发送
Sending cookie as request header in SOAP UI request for rest web service
使用 chrome 或 firefox 建立用户 session(登录)并转到开发人员选项卡并复制 cookie 值并将其与您的 soapUI 请求一起作为 header 发送。 (恭喜,你正在劫持你自己的 session)
对于任何需要传递 cookie 的测试,在 soapUI 中,转到测试用例选项并打开 "maintain HTTP session"。
http://www.soapui.org/soapui-projects/form-based-authentication.html
这是我的 google chrome 开发人员选项卡,它显示了 Whosebug 页面的请求headers
我是 RESTful 服务测试的新手,在与需要传递 Cookie 的端点建立连接时遇到了问题。我有参数和值,但不确定如何在点击请求时手动传递 Cookie(不是通过 header 或 Groovy 脚本)。
只需发送 http header
Cookie: name=value
到服务器
TL;DR
就 http-request 而言,Cookie 只是一个 header,名称为 cookie
,格式为 header-value,格式为 name=value; anothername=anothervalue; yetanotherone=yetanothervalue;
继续阅读
来自https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie
The Cookie HTTP request header contains stored HTTP cookies previously sent by the server with the Set-Cookie header.
The Cookie header is optional and may be omitted if, for example, the browser's privacy settings block cookies.
如何发送Cookie
就像其他人一样 header。唯一的条件是,Header 名称应该是 cookie
并且 Header-value 应该是 name=value; anothername=anothervalue; yetanotherone=yetanothervalue;
格式。
卷曲
curl -v --cookie "USER_TOKEN=my-most-secure-session-id" http://localhost:8080/
如果你想让你的curl读取cookie文件并发送
使用curl -c /path/to/cookiefile http://yourhost/
更多信息:https://curl.haxx.se/docs/http-cookies.html
如何使用 SoapUI 发送
Sending cookie as request header in SOAP UI request for rest web service
使用 chrome 或 firefox 建立用户 session(登录)并转到开发人员选项卡并复制 cookie 值并将其与您的 soapUI 请求一起作为 header 发送。 (恭喜,你正在劫持你自己的 session)
对于任何需要传递 cookie 的测试,在 soapUI 中,转到测试用例选项并打开 "maintain HTTP session"。
http://www.soapui.org/soapui-projects/form-based-authentication.html
这是我的 google chrome 开发人员选项卡,它显示了 Whosebug 页面的请求headers