HTTP POST中的Azure Logic应用程序中出现错误:-“ BadRequest。 Http请求失败:内容不是有效的JSON。”

问题描述 投票:0回答:1

[我已经在Azure中创建了一个逻辑应用程序,它使用HTTP Action Connector将POST请求发送到REST API。

此请求的JSON主体如下所示:-

{
            "id": 40,
            "salutation": "Mr",
            "firstName": "Smith",
            "lastName": "Jack",
            "ageRange": "18-20",
            "gender": "male",
            "emailAddress": "[email protected]",
            "phone": "3532523523",
            "phoneType": "mobile",
            "addressStreet": "1234",
            "addressCity": "gagdgd",
            "addressCounty": "gadgg",
            "addressCountry": "UK",
            "addressPostcode": "235dgds",
            "preferredContactMethod": "email",
            "leadType": "sales",
            "leadForm": "brochure",
            "dealerId": 1111,
            "dealerDepartment": "New Vehicle Sales",
            "externalSalepersonName": "3532532",
            "leadCurrency": "GBP",
            "leadMin": 1000,
            "leadMax": 150000,
            "leadStatus": "New",
            "interestInAccessories": "yes",
            "interestInFinance": "yes",
            "interestInInsurance": "yes",
            "interestInPurchase": "yes",
            "comments": "Test",
            "vehicleModelYear": 2019,
            "vehicleBodyStyle": "saloon",
            "vehicleEngineType": 2,
            "vehicleFuelType": "petrol",
            "transmission": "manual",
            "exteriorColour": "Brown",
            "interiorColour": "Brown",
            "make": "2019",
            "modelDescription": "A-Class",
            "modelYear": 2019,
            "vin": "353253",
            "registrationNumber": "2532532532",
            "odometerReading": 53,
            "serviceDate": "2019-12-04",
            "price": 53253,
            "vinVerified": "no",
            "sentToPOS": "no"
        }

它最初对我有用,但是现在不知何故我开始出现错误,显示为"BadRequest. Http request failed: the content was not a valid JSON."

如果有人对此问题有任何了解,请提供帮助。

enter image description here

azure http post azure-logic-apps
1个回答
0
投票

此问题已解决。问题出在我请求的API未能以有效json格式返回响应的情况下。因此,逻辑应用在格式化HTTP响应时失败。谢谢你们的答复。

© www.soinside.com 2019 - 2024. All rights reserved.