Karate框架中SignatureDoesNotMatch问题排查求助
问题:Karate框架请求出现SignatureDoesNotMatch错误
在Karate框架中执行POST请求时,遇到了SignatureDoesNotMatch错误,但相同的签名和请求体在Postman中可以正常运行,确认签名与payload均正确。
Karate测试代码
* configure headers = {Content-type: 'application/json', Accept: 'application/json', Signature: 'xyz'} And path 'path1' * def requestPayload = read(classpath:path to json ') And request requestPayload When method post Then status 200
pom.xml依赖配置
<!-- https://mvnrepository.com/artifact/com.intuit.karate/karate-junit5 --> <dependency> <groupId>com.intuit.karate</groupId> <artifactId>karate-junit5</artifactId> <version>1.4.1</version> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/com.intuit.karate/karate-apache --> <dependency> <groupId>com.intuit.karate</groupId> <artifactId>karate-apache</artifactId> <version>0.9.6</version> <scope>test</scope> </dependency>
已尝试的解决动作
- 去除请求中的空格
- 参考相关问题时,遇到
bodyAsString未被识别的错误
请求帮助
是否有Karate框架中签名相关的示例可以参考?
内容的提问来源于stack exchange,提问作者Vinaydeep Kaur
相关产品推荐
相关产品推荐

