I am trying to perform CRUD operation for rest api.
Currently I am performing the update operation for a form on button click.
Problem :
In Postman
When I hit the api by passing api key in headers section and required parameters in body section and press "Send", the call completed successfully and I am able to see the response.
In code
When I click the button , the same api gets called but I get error with the below message.
{"status":"error","error":"Please provide a task id"}
What I have tried:
My api call :
Request URL : https://devza.com/tests/tasks/update
Request headers :
authority: devza.com
:method: POST
:path: /tests/tasks/update
:scheme: https
accept: application/json
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
authtoken: MMPIUq9bM8zRUFDWzc7XMMGt8jix38q9
content-length: 104
content-type: application/json
origin: http://localhost:4200
referer: http://localhost:4200/
sec-ch-ua: "Chromium";v="86", "\"Not\\A;Brand";v="99", "Google Chrome";v="86"
sec-ch-ua-mobile: ?0
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36
Request Payload :
[{"taskid":"837","message":"stories","priority":"2","assigned_to":"1","due_date":"2020-11-08 12:12:12"}]
Response : {"status":"error","error":"Please provide a task id"}
As per the response , it asks me for a task id , but it is already provided in the payload section.