How to send a file with json data in Postman?

I know how to publish json, and I know how to publish a file in multi-line form in Postman . But how can I do both together. For instance:

Here is my jason for publishing:

{
    "title": "Post title yeah",
    "body": "My first post body"

}

So how can I send image.jpglocated in /home/me/Desktop, along with the above json?

UPDATE: Please note that I want to send the file using JSON , so my question is different from this . which is a multi-page form submission using Postman.

+4
source share
1 answer

- base64 (https://www.browserling.com/tools/file-to-base64), json. base64 .

{
    "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"
}

enter image description here

0

Source: https://habr.com/ru/post/1681531/


All Articles