Hi guys! I'm trying to create a simple user,post and comments managment application. But, when I try to create a new post or comment I have some troubles. If I try to test post endpoint in the Rest Console, the result is always an error. I've another question about the results headers. Do you know if they works well?? Particularly I mean pagination headers: the current page is correct, while the number of results per page remains always 10 also if it's changed. Do you have encountered these issues? Thanks for the help!
Sample payload for post creation
{ "user_id": 7014014, "title": "Thalassinus despirmatio comburo arceo cometes curto.", "body": "Impedit harum strenuus. Cognomen thymbra coma. Concedo et facere. Chirographum spiculum auxilium. Deorsum illum auris. Aegrus studio suspendo. Crebro amplexus maiores. Tricesimus ceno et. Varietas absens coniuratio. Aurum clementia abbas. Molestias cursus adfero. Derelinquo deleniti acer. Amplitudo deorsum turpe. Aestivus victus apparatus. Usque adhuc vehemens." }
You can try the curl examples available in homepage (they can be converted to any language with help of chatgpt)
you can change the number of results per page upto 100, need pass query parameter per_page
Ex: /public/v2/users?page=1&per_page=20
Thank you very much. Your tips will be very useful!
Do URL id must be equal to body's post_id?
pagination issue in headers is now fixed
POST https://gorest.co.in/public/v2/posts/6940242/comments in this we already have post id in url, no need to add again in body. Also make sure the post id is public or created/modified by you
Thanks, but if I try with this json : { "name":"Dev Tagore", "email": "devtagore@kessler-lebsack.test", "body": "ciao" } and url you provided https://gorest.co.in/public/v2/posts/6940242/comments, this is the answer: [ { "field": "post", "message": "must exist" } ] and if I try to add postid field like this: { "postid": 6940242, "name":"Dev Tagore", "email": "devtagore@kessler-lebsack.test", "body": "ciao" } the issue is the same, same answer
if you want to add comments to post 6940242 then that post must exits either in public data or created/modified by you.
Due space limitations, all user created/modified data will be removed after 6 days
also check GET https://gorest.co.in/public/v2/posts/6940242/
Now it works, thank you very much zeevy!!!