本文介绍了如何在邮递员中发送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图像
发布评论