scotchio | Sample angular 1.5 components app for Scotchio | Frontend Framework library
kandi X-RAY | scotchio Summary
kandi X-RAY | scotchio Summary
Sample angular 1.5 components app for Scotchio
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of scotchio
scotchio Key Features
scotchio Examples and Code Snippets
Community Discussions
Trending Discussions on scotchio
QUESTION
I'm working my way through the ScotchIO tutorial for Express, Node & Mongoose - and i can't seem to get req.body
to come through.
If i make the request in Postman, it works fine - i can see the record update on Mlab:-
But if i make a fetch()
POST request in chrome (testing there until i can get it working, then i'll move to a React Native app), i get a series of ValidationError: User validation failed
(User is my Schema, then it gets more specific with things like ValidatorError: Path
userNameis required.
etc).
ANSWER
Answered 2018-Jul-23 at 15:32Turns out I missed off the body: JSON.stringify({ userName:'myUserName' })
.
So you were right @AlexBlex in that i was sending JSON, just needed json.stringify() to convert it.
Tested and fixed. Many thanks both!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install scotchio
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page