How to receive POST data for webservice?
See original GitHub issueHi, I’m trying to retrieve data from the body of a POST request.
Im defining the resource like this:
[ResourceMethod(RequestMethod.POST)]
public string UpdateData(string id)
{ ... }
I initially tried doing a post request like this: POST http://localhost:8080/data
, and attaching a body like so:
{
"id": "testID"
}
But querying id in the UpdateData method returned empty.
I can make this work if I were to query the uri like so: POST http://localhost:8080/data?id=testID
However I’d like to make it so that I can actually put json data into here, which means attaching the data to the body like I would normally do with a POST request.
Can you let me know what I’m doing wrong? Much appreciated 😃
Issue Analytics
- State:
- Created 3 months ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
c# - Receive POST data on Web Service
I have a website which is supposed to receive data from a web form. I cannot access the code of the webform. I...
Read more >REST: Can I use POST request to read data?
Yes, you can make it work at least using WCF, it's bit different in MVC and Web API where you add attributes to...
Read more >How to get data from a webservice with POST method
I'm trying to get data from a webservice by using the POST-method (JSON formatted), the response would also be JSON. But executing the...
Read more >Post Data using a Web Service - Solutions - AppMachine
Go to the "content" section of your app; · Click Add block. · Select the Pro tab. · Select the Web service block...
Read more >POST data to webservice, receive answer ... and then
Hi, I wrote a sketch to post data to my webservice: String data = "param=hose&user=mi&value=10&p1=a&p2=b&p3=c"; char c = 'x'; ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can confirm, Unity was encoding the data in the backend, once I did it manually issue was all fixed.
Thanks again, love the package!
To be improved in #393