You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a Node API-server to create (what I'd like to call a) "Utils as a Service', as the main application is in C# and some features are easily achieved in Node. Currently, I'm working on a utility that gets html+js as import and DOM-rendered html (or image/pdf) as output.
The thing is, I'm having trouble finding out how to let my API-endpoint use POST-data, instead of GET-data or url-parsed data. In my case, input parameters as GET-variables aren't such a good idea.
What I'm trying to do: curl -X POST http://localhost:3000/DOMrenderHtml/ -d "{"html": "some-data", "outputType:"pdf"}" -H "Content-type: application/json" Result:: request.querystring: { }
Nor is their any trace of my POST-data in the request-variable.
Conclusion:
What am I missing here? Couldn't find any example on how the actual API-call is expected to be made, except:
Server will respond to
GET, POST http://localhost:8080/foo
GET, POST http://localhost:8080/foo/5/true
GET, POST http://localhost:8080/foo_verbose/5
* http://localhost:8080/bar
* http://localhost:8080/1/foo_module/bar
Does this mean POST-data is not supported at all?
I would be very grateful for any help you are able to provide:)
The text was updated successfully, but these errors were encountered:
Hi,
I'm working on a Node API-server to create (what I'd like to call a) "Utils as a Service', as the main application is in C# and some features are easily achieved in Node. Currently, I'm working on a utility that gets html+js as import and DOM-rendered html (or image/pdf) as output.
The thing is, I'm having trouble finding out how to let my API-endpoint use POST-data, instead of GET-data or url-parsed data. In my case, input parameters as GET-variables aren't such a good idea.
I have the following setup:
Router
["/DOMrenderHtml/:html/:outputType", "v1/renderer#render"]
API module
What works:
curl http://localhost:3000/DOMrenderHtml/some-data/pdf/
Result::
request.querystring: { html: 'some-data', outputType: 'pdf' }
What I'm trying to do:
curl -X POST http://localhost:3000/DOMrenderHtml/ -d "{"html": "some-data", "outputType:"pdf"}" -H "Content-type: application/json"
Result::
request.querystring: { }
Nor is their any trace of my POST-data in the request-variable.
Conclusion:
What am I missing here? Couldn't find any example on how the actual API-call is expected to be made, except:
Does this mean POST-data is not supported at all?
I would be very grateful for any help you are able to provide:)
The text was updated successfully, but these errors were encountered: