admin管理员组文章数量:1323224
I have a node.js service and it accepts POST requests. I am trying to use Fiddler to generate the post request. However, when I print the request body in my service, I get an empty object with no data in it. I set the request body in Fiddler to something such as {key:value}
. When printing request.body
in the node.js service I get an empty object {}
.
The request header:
User-Agent: Fiddler
Host: localhost:3000
Content-Length: 10
The body:
{ key:ky }
What am I doing wrong here?
I have a node.js service and it accepts POST requests. I am trying to use Fiddler to generate the post request. However, when I print the request body in my service, I get an empty object with no data in it. I set the request body in Fiddler to something such as {key:value}
. When printing request.body
in the node.js service I get an empty object {}
.
The request header:
User-Agent: Fiddler
Host: localhost:3000
Content-Length: 10
The body:
{ key:ky }
What am I doing wrong here?
Share Improve this question edited Aug 4, 2014 at 4:48 RagHaven asked Aug 4, 2014 at 4:42 RagHavenRagHaven 4,34725 gold badges75 silver badges114 bronze badges 2-
1
if that's the body, it's not valid json, valid json is
{"key": "value"}
, otherwise please provide more code. – OneOfOne Commented Aug 4, 2014 at 4:51 - for example if I want to pass user object how do I do that ? Like this {User: "UserName"} ? – Roxy'Pro Commented Oct 4, 2016 at 12:48
1 Answer
Reset to default 7In the header: Content-Type: application/json
In the body: {"key": "value"}
本文标签: javascriptUsing Fiddler to generate POST request with bodyStack Overflow
版权声明:本文标题:javascript - Using Fiddler to generate POST request with body - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742074888a2419348.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论