Can't make POST request from Postman - rest

I have database in backendless, where I am trying to make POST request. If I open rest console in backendless admin page, there is no problem with making correct POST request. However when I want to make POST from postman it doesn't work, I get error
"code": 8002,
"message": "Could not parse request with message: Error decoding json body: null, status code 400, headers POST
Here is screenshot from backendless as well as from postman. I don't understand, why it is working only from backendless console. Could someone help me, where is the problem? Thanks

You should make POST request with JSON body.
To do it, add
Content-Type: application/json header and define the json body in raw Body tab

I found it confusing too, before I watched a video and realized that I needed to type into the text editor under the Body tab directly under the POST request URL, and not in the output section.
screenshot from postman

Related

Type of context-type application json flutter

I get problem in when I use postman to post api
the header need to be 'Content-Type : application/json'
In First I test with post api token and result is
enter image description here
after that I do the same with other api but result is this
enter image description here
both of api get success but after I post api one and two I got problem cause
they need application/json but in my flutter it's get application/json;charset=UTF8
enter image description here
in your code its content-types Instead of Content-Type maybe check there

Replicatiing post request from website form using postman returns 500 internal server error

I'm trying to replicate a post request done normally by a website form via postman but the server returns 500 error.
the form website URL that I'm dealing with is here.
what I have done so far is investigate the network request using chrome or safari dev tools, copy the request as cURL, import the cURL in postman and do the request.
what can be the possible reasons for the failure and what are the alternative ways to achieve the same result?
Postman Headers:
Most probably you must have used invalid request body. The browser shows parsed json body and you might have copied incomple request body.
To get full body click view source and copy the full content.

How do I get a POST request to work in Confluence REST API?

I'm trying to create a page in confluence, via the REST API. I can do GET requests on specific pages correctly, but when I POST a page to a specific Space I just get a 200 response, containing JSON that is the same as that returned from the same URL using a GET request. No page is created. I'm using Postman, and basic auth.
My POST request url looks like this:
http://myConfluence/rest/api/content/
The body of the request looks like this:
{
"type":"page",
"title":"Test API Page",
"space":{"key":"~myUsername"},
"body": {
"storage": {
"value": "<p>This is a new page</p>",
"representation": "storage"
}
}
}
In the JSON above, the space I'm using is my Home space, however I've tried with various other spaces to no avail. It seems unusual that I would be getting a 200 and the same results as a GET request, but on a POST request. Functionally the POST request seems to be acting as a GET request.
Any advice would be appreciated.
For anyone else weirdly having the same issue, here was the fix:
I changed the URL from
http://myConfluence/rest/api/content/
To
https://myConfluence/rest/api/content/
Silly error that cost a lot of time.

Jmeter error - "error":"unsupported_grant_type","error_description":"grant type not supported"

I was trying to setup Jmeter for Salesforce API testing. However getting the below error during Salesforce authorization:
"error":"unsupported_grant_type","error_description":"grant type not
supported"
I am passing the parameters as in the screenshots attached. The same parameters when passed in Postman works fine, however I am getting this error in Jmeter. Please let me know if I am making some error in passing the parameters in Jmeter.
Jmeter_HTTP Header Manager
Jmeter_HTTP Request
Jmeter_Sampler Result
According to HTTP Status Code 400 documentation
The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Looking into your request, you're sending Content-Type header as application/json therefore your server expects JSON and you're providing something different.
My expectation is that you should switch to Body Data tab of the HTTP Request sampler and set the request body to look like:
Check out REST API Testing - How to Do it Right article for more information on REST APIs testing using JMeter.
I struggle with the same issue but it finally worked for me by doing the following:
Use Content-Type application/x-www-form-urlencoded in an HTTP Header Manager
Make sure is a POST Method and that you're using https
Not sure if it is necessary but in the Parameters tab make sure all (grant_type, password, client_secret_ client_id and username) are Content-Type application/x-www-form-urlencoded and check the URL Encode option for all
Only check "Follow Redirects" and "Use KeepAlive" options in the HTTP Request
hope it works for you too

Postman API Invalid Content-Type Header

I'm trying to test and API call for the Smartsheet API in Postman, but I keep receiving the same error. Even though I am defining the correct Content-Type as per the API documentation, the response I get is the error 1124, which is an invalid content-type header. I haven't been able to figure out exactly what is causing the issue. I have tried typing the header in the address and in the header tab in Postman, but neither option has given me the result I wanted.
Postman Screenshot
If I run the same request in Postman as your screenshot shows (except using my sheet ID), with the same headers that you're using, my request succeeds. i.e., if you're sending the Content-Type header with value application/json for this request, you should not be receiving the error message that you're reporting (1124 - invalid content-type header).
You would, however, receive that error message if you were either not including the Content-Type header at all OR if you were specifying an invalid value for the Content-Type header. A suggestion for troubleshooting: use Fiddler (or a similar tool) to examine the request that's being sent over the wire when you execute this request in Postman -- does it include the Content-Type header, and if so, what's the value of that header?
UPDATE:
Thanks for adding a screenshot of the body you're setting in Postman -- I believe that's the source of your issue. i.e., your Content-Type header says that the request body is in JSON format, but you're actually not sending JSON. To fix this: instead of specifying key/value pairs in Postman, select the raw radio button and specify the body in JSON format. Here's a screenshot of what that looks like: