I am just trying to make calories burned for various exercises using natural language by sending a post request by Nutritionix API and for testing the API, I am using Postman.
Here you can visit the github resouces for request and response: Nutritionix API v2: Natural Exercise Endpoint Sample
POST https://trackapi.nutritionix.com/v2/natural/exercise
POST request body:
{
"query": "Ran 2 miles and walked for 3Km.",
"gender": "male",
"weight_kg": 72,
"height_cm": 160,
"age": 23
}
Headers:
- x-app-id
- x-app-key
- Content-Type: application/json
When I tried to send request by using these data, am getting error message with 400 Bad Request
. I look up on to this error some says try removing the Content-Type: application/json
, but Content-Type
was recommended in the headers thread, with or without it the same error continues as follows:
{
"message": "child \"query\" fails because [\"query\" is required]",
"id": "2a84d18c-8afc-4f22-9278-2e1bc385621b"
}
I just want to get the response 200 OK
. But I don't know how to fix that part. It would be useful for me if I got any help on this matter.