如何在邮递员中发送base64图像

编程入门 行业动态 更新时间:2024-10-27 18:25:33
本文介绍了如何在邮递员中发送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图像

本文发布于:2023-10-29 04:19:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1538707.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:邮递员   图像   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!