How to resolve 400 Bad Request error in Postman in a sample MEAN application - postman

I am working on a sample MEAN application where in I have started to create the node.js related files and connected the same to MongoDB. I have create a POST call which sends the json to the DB. I tried to test the api using postman but not sure whats wrong, I have checked multiple times, the api throws bad request.Any help on this is much appreciated. Thanks.
Added the relevant route.js, app.js and contact.js files for reference in stackblitz link. Added error in postman for reference.
https://stackblitz.com/edit/node-mlodls?file=app.js

Resolved the issue using postman extension. Wondering why the API doesnt work in postman software and works in postman extension

Related

Sending a file to an API using Postman form-data

I'm attempting to send a file to an API I've been developing through Postman, but the API has repeatedly failed to receive it. I initially thought this was a middleware issue, and attempted to use different modules to fix it. However, I have since realized that this is actually an issue in Postman itself
When I send the request and then review the request body in the Postman console, I can see that it fails to send the file at all, listing it as undefined.
I have seen a few people having this same issue, but was not able to find a solution that worked for me. I have already tried unchecking the Content-Type header, as well as closing and reopening the tab and Postman.
EDIT: I did not receive an answer to this, but I was able to find a workaround - coding a super basic html form that made a post request to the relevant endpoint. This did work, so I'm going to say this is likely a bug or settings issue in Postman itself, rather than something to do with my server's code.
Pretty sure you were in this thread already, but just in case,
this answer, and this one might be what you need.

Postman cookies not set for subdomain (Postman Inceptor, Postman Native App)

i am playing around with Postman to get some insight on how things work behind the curtain and ran into, what I believe, is an issue but wanted to ask before I create a new issue on GitHub.
I am intercepting the request from my browser to the same site using the Postman Interceptor to use the request values in the native app. I have cookies enabled and the site (the whole domain) whitelisted.
When I use the history to resend the same request that was captured I get an auth error that is caused by the fact that the cookies are not included in the request (found that out by checking the cURL code snippet). I believe the reason for that is, that the cookies are set under another sub domain than that the request is send to.
I will try to include some pictures to clarify. My question here is:
Am I missing something/did I set something up in the wrong way
or is this an issue and I should create an issue in the official Postman Github page
cURL request
Cookies in Postman Native App
you should see if cookie is being send not using code snippet but the console :
its indeed sending cookies ,

Postman not working for PaymentsOS (Authorization not working)

I tried using paymentsOs in postman and i intend to create authorization. However, i get errors and cannot seem to find out what is the issue here?
Here is my code and the error i got
Problem here

GraphQL Endpoint returns 400

I have a django app built with graphene and I have a problem running a simple POST query for the GraphQL endpoint, it keeps returning a 400 Bad request syntax.
but it should work since I don't have any problems running the query from the endpoint http://localhost:8000/graphql-dev
and I can't see any issues in the way I send the postman request.
I looked online for suitable solutions but couldn't find any that would help.
Any help/tips would be greatly appreciated.
EDIT:
I still didn't manage to see why I'm having this issue with postman, but here are some observations:
first, i changed the request to GET (since in graphql, query is for GET and mutation for POST - sorry, I missed that)
I tried the same request with postman (which didn't work) and with insomnia (which did)
with postman
with insomnia
What's weird is that if i check my django console the requests look the same.
EDIT2: okay, I figured it out...removing the Content-Type application/json did the trick. Now it works with postman as well.

What are the usage limitations of Bitly shortening API?

I've tried Bitly's shortening API to shorten some URL's and after signing up and getting a username/API key, I've been able to shorten URL's in my local computer. But once, the code got deployed to a test server, the shortening fails. Any idea on what could possibly the source for this, or how to track the problem?
Try using PostMan ( chrome ) or HTTP Requestor ( firefox / my preference ) to post the JSON request you are sending to the API, review the error code and see if it has any useful errors (http://jsonformatter.curiousconcept.com/ is nice for reviewing it ).
Alternatively if you have no UI in the server use a CURL request from the server.
What language are you sending this in by the way? I am assuming JSON (not XML) is being sent eventually? What kind of server is it? Could you post the error code please?
Best of Luck!