我有一个curl post请求到我的服务器,她的身体不解析正确
这是来自服务的 curl 请求
curl -d '{"merchantAccount":"pipedrive_youscore_rubicon_ltd","orderReference":"WFP-BTN-7181819-635e48482b33d","merchantSignature":"7bf****************c","amount":3,"currency":"UAH","authCode":"326470","email":"rubicon.sergii@gmail.com","phone":"380669114250","createdDate":1667123272,"processingDate":1667123284,"cardPan":"44****6705","cardType":"Visa","issuerBankCountry":"Ukraine","issuerBankName":"MONObank","recToken":"","transactionStatus":"Approved","reason":"Ok","reasonCode":1100,"fee":0.07,"paymentSystem":"googlePay","acquirerBankName":"WayForPay","cardProduct":"credit","clientName":"Rubicon Sergii","products":[{"name":"\u0422\u0435\u0441\u0442\u043e\u0432\u0438\u0439 \u0442\u043e\u0432\u0430\u0440","price":3,"count":1}],"clientFields":[{"name":"\u0414\u043e\u043c\u0435\u043d \u043f\u043e\u0440\u0442\u0430\u043b\u0443","value":"rawgsag"}]}' http://app.rubicon.tips:3000/checkSupPay
这是对请求的回应:
'{"merchantAccount":"pipedrive_youscore_rubicon_ltd","orderReference":"WFP-BTN-7181819-6361151577ee8","merchantSignature":"5f0f*************bc6536a98dd","amount":3,"currency":"UAH","authCode":"126496","email":null,"phone":null,"createdDate":1667306773,"processingDate":1667307818,"cardPan":"","cardType":null,"issuerBankCountry":null,"issuerBankName":null,"recToken":"","transactionStatus":"Refunded","reason":"Ok","reasonCode":1100,"fee":0,"paymentSystem":"googlePay","acquirerBankName":"WayForPay","cardProduct":"credit","clientName":null,"products":': {
'{"name":"\\u0422\\u0435\\u0441\\u0442\\u043e\\u0432\\u0438\\u0439 \\u0442\\u043e\\u0432\\u0430\\u0440","price":3,"count":1}': {
'{"name":"\\u0414\\u043e\\u043c\\u0435\\u043d \\u043f\\u043e\\u0440\\u0442\\u0430\\u043b\\u0443","value":"qh34hh44h"}': ''
}
}
}
我正在尝试用
bodyParser.urlencoded({ extended: true })
和bodyParser.json()
,但它的最大工作量(
1条答案
按热度按时间iyr7buue1#
您的内容类型目前为:
您应该更改数据或内容类型。
如果要求数据为JSON,则添加-H 'Content-Type:应用程序/json
但如果它起作用了,那就没关系了。
但您的问题很可能是JSON格式不正确。
看看这几行字的结尾:
行尾的字符不包括在字符串中。
前两行的末尾
: {
不是字符串的一部分。第三行末尾的
: ''
不在字符串中。