HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to POST discussion using curl apiv2
dhanavel
New
Hi,
I installed OpenSource Vanilla 3.2 and tried GET method to retrieve discussion using api v2. It works perfectly.
curl http://<localhost>/index.php?p=/api/v2/discussions
whereas POST method is failing.
curl -X POST -d @discussion.json -H "accept: application/json" -H "Content-Type: application/json" -H "x-transient-key: va.97oEsAkj35XlbjCcs6svM7H-lxTlNc6S.lCyEcg.uSVzdRr" http://<localhost>/index.php?p=/api/v2/discussions
{
"message": "Invalid CSRF token. Please try again.",
"status": 403,
"msg": "Invalid CSRF token. Please try again.",
"code": 403,
"except": [],
"type": "!csrf",
"description": null
}
looking for example how to POST discussion via command like { curl , python requests} to vanilla.
Thanks in Advance.
Regards,
Dhanavel
1
Answers
any help here ?
You need to handle cookies correct
Better than using that would be to use the API but you need to handle individual token creation by yourself.
Browse through my GitHub repos, I think I have a test implementation somewhere...