1

I'm trying to craft a curl request to upload an image to the user_picture field on a user entity using json:api.

The documentation is, umm, minimal, but I've used it as a starting point and I have this:

curl -s -X POST -b cookie.txt \
    --header "Accept: application/vnd.api+json" \
    --header "Content-type: application/octet-stream" \
    --header "X-CSRF-Token: $TOKEN" \
    --header "Content-Disposition: file: filename=test.jpg" \
    --data-binary "@test.jpg" \
    http://localhost/jsonapi/user/user/$UUID/user_picture

The response for this is "No route found that matches \"Content-Type: application/x-www-form-urlencoded\"".

What am I doing wrong?

1 Answer 1

1

As soon as I posted this I realised my issue, Content-type instead of Content-Type, duh!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.