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

时间:2019-12-04 12:49:54

标签: azure http post azure-logic-apps

我已经在Azure中创建了一个逻辑应用,该应用使用HTTP Action Connector来向REST API发送请求。

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

{
            "id": 40,
            "salutation": "Mr",
            "firstName": "Smith",
            "lastName": "Jack",
            "ageRange": "18-20",
            "gender": "male",
            "emailAddress": "atet4gsg@gmail.com",
            "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

1 个答案:

答案 0 :(得分:0)

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