连接到API时,PowerApps中找不到资源?

时间:2017-11-11 09:41:39

标签: azure swagger azure-functions powerapps

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

我的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内部服务器问题。

enter image description here

0 个答案:

没有答案