Replies: 1 comment 1 reply
-
Hey @ithuis Yes you are correct you would use the HasMultipartBody trait which is detailed here: https://docs.saloon.dev/the-basics/request-body-data/multipart-form-body I imagine you would have an implementation like this on your request class YourRequest extends Request implements HasBody
{
use HasMultipartBody;
// ...
protected function defaultBody(): array
{
return [
return new MultipartValue('image_file', 'file-contents-or-stream', 'file-name.jpg'); // Note your extension might be different
];
}
} Hope this helps |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i am trying to upload an image to bigcommerce. the Api reference says there is a required field name "image_file" and i must be send using the multipart/form-data media type.
but i cant figure out how to add the "image_file" field? is that possible? using the HasMultipartBody trait?
Beta Was this translation helpful? Give feedback.
All reactions