我调用的时https://pixian.ai/api里的API
下面是我的源码
.版本 2
.子程序 Send_API, , , Pixian.ai 抠图API
.参数 图片路径, 文本型, , 本地图片路径
.局部变量 JSON, 类_json
.局部变量 api_key, 文本型, , , 接口密钥
.局部变量 api_endpoint, 文本型, , , 请求地址
.局部变量 api_inputimage, 文本型, , , 提交图片
.局部变量 headers, 文本型, , , 头部信息
.局部变量 payload, 文本型, , , 发送数据
.局部变量 response, 文本型, , , 响应内容
.局部变量 back, 逻辑型, , , 返回文本
api_key = “cHhhaDZyczVwNWk0OWRxOjlkcHY2ZHZsYTJyYTR0ODV0MjJlbTk0YmtmM2oxNDZnYnNycG82YmR1ajBsZmprNGwwdDk=” ' key没问题
api_endpoint = “https://api.pixian.ai/api/v2/remove-background”
api_inputimage = 到文本 (编码_BASE64编码A (读入文件 (图片路径))) ' 编码后内容没问题
headers = “Authorization: Basic ” + api_key
payload = “image.base64=” + api_inputimage + “&max_pixels=” + “25000000” + “&background.color=” + “#0055FF” + “&result.crop_to_foreground=” + “false” + “&result.margin=” + “0px” + “&result.target_size=” + “1920 1080” + “&result.vertical_alignment=” + “middle” + “&output.format=” + “auto” + “&output.jpeg_quality=” + “75”
response = 到文本 (网页_访问_对象 (api_endpoint, 1, payload, , , headers))
back = JSON.解析 (response, 真)
.如果真 (JSON.取通用属性 (“error.status”) = “500”)
信息框 (JSON.取通用属性 (“error.message”), 0, , )
提交之后一直返回
{"error":{"status":500,"code":-1,"message":"Internal Server Error: Sorry, unable to read that image, please try another - if this persists, please contact us, thanks!"}
本人萌新一枚试了好多次都不知道问题在哪,有大佬可以帮忙解惑吗?