0

我正在尝试使用自定义连接器将一些图像发送到电源应用程序。

我的 OpenAPI 文件看起来像这样 -

{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Upload To Function"
},
"host": "XXXXXXXXXXXXX/.azurewebsites.net",
"paths": {
"/api/HttpTriggerCSharp/name/{name}": {
  "post": {
    "tags": [
      "HttpTriggerCSharp"
    ],
    "operationId": "UploadImage",
    "consumes": [
      "multipart/form-data"
    ],
    "produces": [
      "application/json",
      "text/json",
      "application/xml",
      "text/xml"
    ],
    "parameters": [
      {
        "name": "file",
        "in": "formData",
        "required": true,
        "type": "file",
        "x-ms-media-kind": "image"
      },
      {
        "name": "name",
        "in": "path",
        "required": true,
        "type": "string"
      }
    ],
    "responses": {
      "200": {
        "description": "Saved successfully"
      },
      "400": {
        "description": "Could not find file to upload"
      }
    },
    "summary": "Image Upload",
    "description": "Image Upload"
  }
  }
 },
 "definitions": {}
}

我的函数工作正常,因为我使用 POSTMAN 以及在 Azure 函数门户中对其进行了测试。但是当我使用这个 swagger 文件在 Powerapps 上测试它时,我得到状态代码 404,找不到资源错误。

我在 Powerapps 中这样调用我的函数 -

Uploadtofunction.uploadimage(MainimageView.image,{filename:"test")

任何想法,为什么它不起作用?

编辑:这是我在 POSTMAN 上测试它的方法。我认为它也与swagger中的文件名有关。因为当我在正文中添加名称/文件名时,我得到 500 个内部服务器问题。

在此处输入图像描述

4

0 回答 0