Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mazedul's avatar

How to send a file with Guzzle?

Hi, How do you upload a file and send it with Guzzle HTTP post request. Here's the same curl code:

curl https://upload.box.com/api/2.0/files/content \
  -H "Authorization: Bearer ACCESS_TOKEN" -X POST \
  -F attributes='{"name":"tigers.jpeg", "parent":{"id":"11446498"}}' \
  -F file=@myfile.jpg

I couldn't figure out where to add the files with the Guzzle so it will send with the request. I also need to know how to add the attributes.

0 likes
0 replies

Please or to participate in this conversation.