curl -X POST -d @/home/prabhat/house.yaml -H "Content-type: text/x-yaml" http://localhost:8080/eejot-rest/rest/houses
curl strips all newline which is what a browser does. YAML depends on new line and white spaces so that would result into all sort of deserialization issues on server side. The correct way to do instead is
curl -X POST --data-binary @/home/prabhat/payload.yaml -H "Content-type: text/x-yaml" http://localhost:8080/eejot-rest/rest/houses
Curl man page is very clear on this but sometimes we tend to have false assumption. RTFM Prabhat!
No comments:
Post a Comment