状态为200 OK的“ Android Logcat”和“ Postman”的结果不同

时间:2018-11-14 05:12:35

标签: android json postman logcat

对于相同的GET请求,我从android logcat和邮递员响应中得到了不同的结果,如下所示:

Android Logcat请求:

D/OkHttp: --> GET 
http://companyname.com/api/Sales/FetchOrderRequestCompetitor? 
Id=5737&Type=B&CategotyId=&BrandId=&CustomerId= http/1.1
Authorization: BA5BA5DC-8147-4924-9BCA-558508
X-User-Id-1: 4J6333gM4cXhX+Rv4h7qsw==
Connection: close
--> END GET

Android Logcat响应:

Response: {"CompetitorProducts": 
[{"CompetitorId":"C13","CompetitorName":"Computer","ReturnRqst": 
[{"ProductId":"3030","ProductName":"ProductA","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3054","ProductName":"Nokia(mobile)","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3030","ProductName":"ProductA","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3031","ProductName":"Product","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3054","ProductName":"Nokia(mobile)","Quantity":"","Amount":"0.00","DiscountPercentage":"0"}]},{"CompetitorId":"00LG","CompetitorName":"LG","ReturnRqst":[{"ProductId":"3030","ProductName":"ProductA","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3054","ProductName":"Nokia(mobile)","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3030","ProductName":"ProductA","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3031","ProductName":"Product","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3054","ProductName":"Nokia(mobile)","Quantity":"","Amount":"0.00","DiscountPercentage":"0"}]},{"CompetitorId":"Mobilecomp","CompetitorName":"mobileee","ReturnRqst":[{"ProductId":"3030","ProductName":"ProductA","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3054","ProductName":"Nokia(mobile)","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3030","ProductName":"ProductA","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3031","ProductName":"Product","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"ProductId":"3054","ProductName":"Nokia(mobile)","Quantity":"","Amount":"0.00","DiscountPercentage":"0"}]}],"DefaultCustomer":"21024","IsCustomerDisplay":true,"IsAllowDateModification":false,"MonthsAllowed":[{"MonthNo":11,"MonthName":"November","StartDate":"01-11-2018","EndDate":"30-11-2018"},{"MonthNo":10,"MonthName":"October","StartDate":"01-10-2018","EndDate":"31-10-2018"},{"MonthNo":9,"MonthName":"September","StartDate":"01-09-2018","EndDate":"30-09-2018"},{"MonthNo":8,"MonthName":"August","StartDate":"01-08-2018","EndDate":"31-08-2018"},{"MonthNo":7,"MonthName":"July","StartDate":"01-07-2018","EndDate":"31-07- 2018"}],"CustomerInfo":null,"Status":"Success","error":null}

邮递员请求(GET):

http://companyname.com/api/Sales/FetchOrderRequestCompetitor?Id=5737&Type=B&CategotyId=&BrandId=&CustomerId=

[{"key":"Authorization","value":"BA5BA5DC-8147-4924-9BCA-558508"},{"key":"X-User-Id-1","value":"4J6333gM4cXhX+Rv4h7qsw=="}]

邮递员回复:

{
    "CompetitorProducts": [
        {
            "CompetitorId": "C13",
            "CompetitorName": "Computer",
            "ReturnRqst": [
                {
                    "ProductId": "3030",
                    "ProductName": "ProductA",
                    "Quantity": "",
                    "Amount": "0.00",
                    "DiscountPercentage": "0"
                },
                {
                    "ProductId": "3054",
                    "ProductName": "Nokia(mobile)",
                    "Quantity": "",
                    "Amount": "0.00",
                    "DiscountPercentage": "0"
                }
            ]
        },
        {
            "CompetitorId": "00LG",
            "CompetitorName": "LG",
            "ReturnRqst": [
                {
                    "ProductId": "3030",
                    "ProductName": "ProductA",
                    "Quantity": "",
                    "Amount": "0.00",
                    "DiscountPercentage": "0"
                },
                {
                    "ProductId": "3031",
                    "ProductName": "Product",
                    "Quantity": "",
                    "Amount": "0.00",
                    "DiscountPercentage": "0"
                }
            ]
        },
        {
            "CompetitorId": "Mobilecomp",
            "CompetitorName": "mobileee",
            "ReturnRqst": [
                {
                    "ProductId": "3054",
                    "ProductName": "Nokia(mobile)",
                    "Quantity": "",
                    "Amount": "0.00",
                    "DiscountPercentage": "0"
                }
            ]
        }
    ],
    "DefaultCustomer": "21024",
    "IsCustomerDisplay": true,
    "IsAllowDateModification": false,
    "MonthsAllowed": [
        {
            "MonthNo": 11,
            "MonthName": "November",
            "StartDate": "01-11-2018",
            "EndDate": "30-11-2018"
        },
        {
            "MonthNo": 10,
            "MonthName": "October",
            "StartDate": "01-10-2018",
            "EndDate": "31-10-2018"
        },
        {
            "MonthNo": 9,
            "MonthName": "September",
            "StartDate": "01-09-2018",
            "EndDate": "30-09-2018"
        },
        {
            "MonthNo": 8,
            "MonthName": "August",
            "StartDate": "01-08-2018",
            "EndDate": "31-08-2018"
        },
        {
            "MonthNo": 7,
            "MonthName": "July",
            "StartDate": "01-07-2018",
            "EndDate": "31-07-2018"
        }
    ],
    "CustomerInfo": null,
    "Status": "Success",
    "error": null
}

两个请求看起来都一样,但是给出不同的结果。有人可以帮我澄清一下,我要去哪里错了。谢谢。

0 个答案:

没有答案