多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] # HTTP Header Exists(未校验) HTTP Header存在断言检查请求或响应中是否存在您指定名称的Header。 >[warning]本断言适用于在响应中接收HTTP消息的测试步骤和虚拟API。 ## 适用场景 你可以在ReadyAPI套件的不同应用程序中使用此断言。根据应用程序的不同,断言验证以下数据: | 应用 | 检查数据 | 更多信息 | | --- | --- | --- | | [SoapUI](https://support.smartbear.com/readyapi/docs/soapui/intro/about.html) | request 和 response Header | [SoapUI断言](https://support.smartbear.com/readyapi/docs/testing/assertions/soap.html) | | [Secure ](https://support.smartbear.com/readyapi/docs/secure/intro/about.html) | response Header | [Security 断言](https://support.smartbear.com/readyapi/docs/secure/assertions.html) | | [ServiceV](https://support.smartbear.com/readyapi/docs/servicev/intro/about.html) | response Header | [ServiceV断言](https://support.smartbear.com/readyapi/docs/servicev/validating/assertions.html) | ## 创建断言 1、在对话框的左边,选择 **Compliance, Status and Standards** 类别。 2、在对话框的右边,选择 **HTTP Header Exists** 。 3、点击 **Add** 。 **SoapUI** ![SoapUI:The assertions Panel](https://support.smartbear.com/readyapi/docs/_images/testing/assertions/reference/create-soap.png) **Secure** ![Secure:The assertions Panel](https://support.smartbear.com/readyapi/docs/_images/testing/assertions/reference/create-secure.png) **ServiceV** ![ServiceV:The assertions Panel](https://support.smartbear.com/readyapi/docs/_images/testing/assertions/reference/create-servicev.png) ## 设置断言 指定Header名称。若要检查多个Header,请添加更多的Header存在断言。 ![ReadyAPI:Configuring the HTTP Header Exists assertion](https://support.smartbear.com/readyapi/docs/_images/testing/assertions/reference/compliance/header-exists.png) ## 状态代码和Header的其他断言 您可能需要为HTTP状态代码和响应Header添加更多的断言: ● [无效HTTP状态码断言](https://support.smartbear.com/readyapi/docs/testing/assertions/reference/compliance/http-invalid.html) ● [有效HTTP状态码断言](https://support.smartbear.com/readyapi/docs/testing/assertions/reference/compliance/http-valid.html) ● [HTTP Header等于断言](https://support.smartbear.com/readyapi/docs/testing/assertions/reference/compliance/header-equals.html) **参考资料** [1、ReadyAPI Documentation / Testing APIs / Verifying Results / Assertion Reference / Compliance Assertions / HTTP Header Exists](https://support.smartbear.com/readyapi/docs/index.html) --- :-: --- 贡献者名单(排名不分先后) --- :-: **材料** :-: **编写** 苏娟 :-: **校验** :-: **支持**