Skip to content
This repository was archived by the owner on Oct 23, 2019. It is now read-only.

Conversation

@3-16
Copy link

@3-16 3-16 commented Feb 18, 2013

Although the optimal and most common way is to send JSON data to a REST
API, there are cases when you need to use existing systems to POST and
PUT data. These can send a common HTTP form like
"value1=data1&data2=value2"

Check if the submitted data is in JSON format. If it is not, try to use
querystring.parse(requestData) to convert the requestData to JSON
format. If this does not work either, send the error message to the
client.

Although the optimal and most common way is to send JSON data to a REST
API, there are cases when you need to use existing systems to POST and
PUT data. These can send a common HTTP form like "value1 = value2 =
data1 & data2".

Check if the submitted data is in JSON format. If it is not, try to use
querystring.parse(requestData) to convert the requestData to JSON
format. If this does not work either, send the error message to the
client.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant