如何在邮递员中发送base64图像 [英] How to send a base64 image in postman

查看:126
本文介绍了如何在邮递员中发送base64图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要使用以base64编码的图像向api发出请求,该请求是放置请求,而我尝试使用原始格式在主体部分中进行添加,即添加以下json:

Need to make a request to a api with a image encoded in base64, the request is a put, and i was trying making in the body section using the raw format and adding i.e. this json:

{
 "picture": {
    "name": "/Users/Cokeina/Desktop/imagenes/default_avatar.png",
    "content_type": "image/png",
    "file": "base64string"
 }
}

但似乎不起作用,正确的方法是什么?

but seems like this isn't working, what is the correct way to do this?

推荐答案

您可以找到在线base64图像编码器。他们将图像编码为字符串。

You could find online base64 image encoder. They encode an image to a string.

POSTMAN中JSON格式的原始主体示例:

The example of raw body in JSON format in the POSTMAN:

"profile": {
    "first_name": "John",
    "last_name": "Dow",
    "photo": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII="
}

我认为, name和 content_type在JSON中很明显

I think, that "name" and "content_type" is obvious in your JSON.

这篇关于如何在邮递员中发送base64图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆