I want to test that a PUT to an endpoint (products/:id
) works, but when I try
curl -X PUT -d listing_id_created=True localhost:3000/products/27
it gives ActionController::InvalidAuthenticityToken
, which I now realise is the expected result (since there's no authenticity token provided since the PUT is coming from curl and curl doesn't know anything about it).
So my question is how do I run some simple curl PUT
s (or any other verbs) to check that endpoints work correctly? Is the only solution to simply disable/skip the authenticity token?