在日食中使用空手道发送POST请求时出现403错误

时间:2020-01-15 12:12:44

标签: java eclipse api http-status-code-403 karate

我可以使用Postman中的POST请求访问端点。 但是,如果我在日食中使用空手道尝试相同操作,则会收到403错误。下面是快照。

1 > POST http://localhost:8080/MyEndPoint
1 > Accept-Encoding: gzip,deflate
1 > Content-Length: 86
1 > Content-Type: application/json; charset=UTF-8
1 > Host: localhost:8080
1 > Proxy-Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_221)
{"credRelFreeIncome":10,"interestIncome":2,"internalExpectedLoss":3,"nonCredIncome":5}
12:35:52.974 [ForkJoinPool-1-worker-1] DEBUG com.intuit.karate - response time in milliseconds: 
45.54
1 < 403
1 < Cache-Control: no-cache
1 < Content-Type: text/html
1 < Content-length: 14520
1 < Server: Zscaler/5.7

我已经在karate-config.js中设置了必要的代理设置-karate.configure('proxy','myworkingproxy:8080'),但仍然无法正常工作。

Spring安全性尚未在项目中实现,因此我想它也不与CSRF令牌有关。

在邮递员中可用的卷曲URL:
curl -X POST \
http://localhost:8080/getPricingCalculation/getRoE \
-H'缓存控制:无缓存'\
-H'内容类型:application / json'\
-H'邮递员令牌:6e9c0433-3977-4612-b989-f2a920e34a86'\
-d'{
“ credRelFreeIncome”:10,
“ interestIncome”:2,
“ internalExpectedLoss”:3,
“ nonCredIncome”:5
}'

空手道特征文件-出现403错误

背景:
* url'http://localhost:8080'
*标头Content-Type ='application / json'

场景:
给定路径'/ getPricingCalculation / getRoE'
并请求{“ credRelFreeIncome”:10,“ interestIncome”:2,2,“ internalExpectedLoss”:3,“ nonCredIncome”:5}
当方法POST
然后状态200

有人可以帮忙吗?

最好的问候, 阿比

0 个答案:

没有答案
相关问题