问题
Am am currently using Postman to test the api results. I have been following the apostrophe headless docs, since am completely new to this. so what i need is to submit a post request in Postman to add a piece and its fields from REST api. I have got the bearer token and login was success. but when i insert a piece with body as JSON schema. am getting a error message. May be the way am doing is wrong. so can one one help me in Making a post request to add piece and fields through POSTMAN atleast?
回答1:
I did not understand the question quite right. You should add some of your inputs, error message, url, pics and etc. to clarify the problem. However, if you need an example to how to use postman to make a POST request, it's like this:
- Select the POST method and insert the API URL (The landing url for POST method not the view and etc.)
- Go to headers Tab and add the Authorization token to header
- Select the Body tab; Then raw type and finally JSON type. Now insert the Json body and click Send.
- You can see the result of webservice call on the top of response window. If it returned 200, everything was OK.
来源:https://stackoverflow.com/questions/64513614/inserting-updating-pieces-and-its-fields-via-apostrophe-headless-rest-api