I know how to post json and I know how to post file in multipart form in Postman. But how can I do both together. For example:
Here is my jason to post:
{
"title": "Post title yeah",
"body": "My first post body"
}
So how can I post image.jpg
located at /home/me/Desktop
along with the the above json?
UPDATE: Note that I want so send file using JSON, so my question is different from this which is about multipart form sending using Postman.
You can use this online tool to convert your file to a base64 (https://www.browserling.com/tools/file-to-base64), then you can send it as part of the json. I reduced the size of the base64 string for the answer.
{
"title": "Post title yeah",
"body": "My first post body",
"image": "JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9MZW5ndGggMjcyNS9GaWx0ZXIvRmxhdGVEZWNvZGU+PnN0cmVhbQpYCb1c247byBF9X8D/0MC+JIFNs5t9IY0gwHicXRjI2GOPvPsQ5EGrocdKRGmiofby9+kmu5t901BFKoLhi8qqc04Xq07zZr/47r8olz84JlmORKV+3dfoZ7R9If8GcxVkeUZLjijNBEOYZhgT+523C/T6hwJVWVVVaPG1w5IID4gxluESLf6BMMuqkkqYImOMoMU9+tPH/X29R9+/+TNa/Bst/oL+vnjx3aeBkJcZqwQilfwwnU/gjFe843u3bOuYjHcLUstjVYlwgfX6cp+NJtgoI5no6RQKKSWMTGQ9HaG4EDzio2o9QshqckkjMklGMsJAbAqjIBKlyHJOO7acvCb8NcnlFzB7g+kbUqbrykUla0kR491CeVZFdcV4vLC8JFlJy477bre5R4v"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With