【问题标题】:Rest API post request not working in Postman for Mac and Ubuntu but working in Windows onlyRest API 发布请求不适用于 Mac 和 Ubuntu 的 Postman,但仅适用于 Windows
【发布时间】:2017-04-19 08:35:49
【问题描述】:

API:http://115.249.4.198:8288/Services/Common/prospectService.svc/IosAddLead

请求正文:

{
    "baseEntity":{
        "BaseDBName":"BuddyCRMDB_001",
        "BaseSubscriptionID":"Buddy_001",
        "CustomEditId":0,
        "BaseUserID":1
    },
    "CustomerEntity":{
        "tradingFields":[
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":true,
                "FieldName":"Account Profile",
                "FieldNameMaster":"AccountProfile",
                "IsVisible":true,
                "IsExisting":true,
                "ID":19,
                "Value":1
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":true,
                "FieldName":"Contact Frequency",
                "FieldNameMaster":"ContactFrequency",
                "IsVisible":true,
                "IsExisting":true,
                "ID":22,
                "Value":3
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":true,
                "FieldName":"Lead Source",
                "FieldNameMaster":"LeadSource",
                "IsVisible":true,
                "IsExisting":true,
                "ID":21,
                "Value":1
            },
            {
                "FieldDataType":"Date",
                "IsMandatory":false,
                "FieldName":"trade date",
                "FieldNameMaster":"trade date",
                "IsVisible":true,
                "IsExisting":false,
                "ID":4264,
                "Value":""
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":true,
                "FieldName":"Lead Status",
                "FieldNameMaster":"LeadStatus",
                "IsVisible":true,
                "IsExisting":true,
                "ID":48,
                "Value":3
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":true,
                "FieldName":"Campaign11",
                "FieldNameMaster":"CampaignID",
                "IsVisible":true,
                "IsExisting":true,
                "ID":44,
                "Value":5
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Other Supplier",
                "FieldNameMaster":"OtherSupplier",
                "IsVisible":true,
                "IsExisting":true,
                "ID":27,
                "Value":""
            },
            {
                "FieldDataType":"DropDown",
                "IsMandatory":false,
                "FieldName":"BudgetYear StartDate",
                "FieldNameMaster":"BudgetYearStartDate",
                "IsVisible":true,
                "IsExisting":true,
                "ID":24,
                "Value":0
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":false,
                "FieldName":"Industry",
                "FieldNameMaster":"Industry",
                "IsVisible":true,
                "IsExisting":true,
                "ID":28,
                "Value":0
            },
            {
                "FieldDataType":"Numeric",
                "IsMandatory":false,
                "FieldName":"MX System",
                "FieldNameMaster":"AnnualRevenue",
                "IsVisible":true,
                "IsExisting":true,
                "ID":29,
                "Value":""
            },
            {
                "FieldDataType":"Numeric",
                "IsMandatory":false,
                "FieldName":"Credit Terms",
                "FieldNameMaster":"CreditTerms",
                "IsVisible":true,
                "IsExisting":true,
                "ID":32,
                "Value":""
            },
            {
                "FieldDataType":"Numeric",
                "IsMandatory":false,
                "FieldName":"Credit Limit",
                "FieldNameMaster":"CreditLimit",
                "IsVisible":true,
                "IsExisting":true,
                "ID":33,
                "Value":""
            },
            {
                "FieldDataType":"DropDown",
                "IsMandatory":false,
                "FieldName":"Usual Spend Date",
                "FieldNameMaster":"UsualSpendDate",
                "IsVisible":true,
                "IsExisting":true,
                "ID":25,
                "Value":0
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":false,
                "FieldName":"trade drop",
                "FieldNameMaster":"trade drop",
                "IsVisible":true,
                "IsExisting":false,
                "ID":3263,
                "Value":""
            },
            {
                "FieldDataType":"Numeric",
                "IsMandatory":false,
                "FieldName":"trade numeric",
                "FieldNameMaster":"trade numeric",
                "IsVisible":true,
                "IsExisting":false,
                "ID":4265,
                "Value":""
            }
        ],
        "RecordId":0,
        "masterFields":[
            {
                "FieldDataType":"Text",
                "IsMandatory":true,
                "FieldName":"Company name",
                "FieldNameMaster":"CompanyName",
                "IsVisible":true,
                "IsExisting":true,
                "ID":4,
                "Value":"test new "
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Range",
                "FieldNameMaster":"Range",
                "IsVisible":true,
                "IsExisting":false,
                "ID":1235,
                "Value":""
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":true,
                "FieldName":"lead drop",
                "FieldNameMaster":"lead drop",
                "IsVisible":true,
                "IsExisting":false,
                "ID":3259,
                "Value":"Three"
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":true,
                "FieldName":"Owner",
                "FieldNameMaster":"OwnerID",
                "IsVisible":true,
                "IsExisting":true,
                "ID":6,
                "Value":1
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Website",
                "FieldNameMaster":"Website",
                "IsVisible":true,
                "IsExisting":true,
                "ID":8,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Twitter",
                "FieldNameMaster":"Twitter",
                "IsVisible":true,
                "IsExisting":true,
                "ID":9,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Facebook",
                "FieldNameMaster":"Facebook",
                "IsVisible":true,
                "IsExisting":true,
                "ID":10,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Building",
                "FieldNameMaster":"Building",
                "IsVisible":true,
                "IsExisting":true,
                "ID":11,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Street",
                "FieldNameMaster":"Street",
                "IsVisible":true,
                "IsExisting":true,
                "ID":12,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"City",
                "FieldNameMaster":"City",
                "IsVisible":true,
                "IsExisting":true,
                "ID":13,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"ZipCode",
                "FieldNameMaster":"ZipCode",
                "IsVisible":true,
                "IsExisting":true,
                "ID":36,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"State",
                "FieldNameMaster":"State",
                "IsVisible":true,
                "IsExisting":true,
                "ID":34,
                "Value":""
            },
            {
                "FieldDataType":"DropDown",
                "IsMandatory":false,
                "FieldName":"Country",
                "FieldNameMaster":"CountryID",
                "IsVisible":true,
                "IsExisting":true,
                "ID":35,
                "Value":0
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Phone",
                "FieldNameMaster":"Phone",
                "IsVisible":true,
                "IsExisting":true,
                "ID":37,
                "Value":""
            },
            {
                "FieldDataType":"Date",
                "IsMandatory":false,
                "FieldName":"lead date",
                "FieldNameMaster":"lead date",
                "IsVisible":true,
                "IsExisting":false,
                "ID":3260,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Lead text",
                "FieldNameMaster":"Lead text",
                "IsVisible":true,
                "IsExisting":false,
                "ID":3258,
                "Value":""
            },
            {
                "FieldDataType":"Numeric",
                "IsMandatory":false,
                "FieldName":"lead numeric",
                "FieldNameMaster":"lead numeric",
                "IsVisible":true,
                "IsExisting":false,
                "ID":3261,
                "Value":""
            },
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":false,
                "FieldName":"Testdroppp",
                "FieldNameMaster":"Testdroppp",
                "IsVisible":true,
                "IsExisting":false,
                "ID":4273,
                "Value":""
            }
        ],
        "BasicContactList":[
            {
                "FieldDataType":"Dropdown",
                "IsMandatory":true,
                "FieldName":"Title",
                "FieldNameMaster":"Title",
                "IsVisible":true,
                "IsExisting":true,
                "ID":14,
                "Value":3
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":true,
                "FieldName":"First Name",
                "FieldNameMaster":"FirstName",
                "IsVisible":true,
                "IsExisting":true,
                "ID":15,
                "Value":"asdfasd"
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":true,
                "FieldName":"Last Name",
                "FieldNameMaster":"LastName",
                "IsVisible":true,
                "IsExisting":true,
                "ID":16,
                "Value":"asdasdasd"
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Job Title",
                "FieldNameMaster":"JobTitle",
                "IsVisible":true,
                "IsExisting":true,
                "ID":17,
                "Value":""
            },
            {
                "FieldDataType":"Text",
                "IsMandatory":false,
                "FieldName":"Email",
                "FieldNameMaster":"Email",
                "IsVisible":true,
                "IsExisting":true,
                "ID":18,
                "Value":""
            }
        ]
    },
    "completeAddress":""
}

我想知道为什么这个请求只在 Postman for Windows 中有效。所有标题和设置都相同。 Postman在所有机器上的版本号都是一样的。

【问题讨论】:

标签: wcf-data-services postman


【解决方案1】:

既然你说你在 ubuntu 上遇到超时错误。验证您是否可以在 ubuntu 机器上实际连接到互联网。试试这个。

ping -c 10 somesite.net

你有防火墙吗?您是否需要在您的 ubuntu 系统上设置代理。将你的 windows 系统的代理设置与你的 ubuntu 系统进行比较。

【讨论】:

  • 不,事实并非如此
  • 你知道你可以在邮递员的回复框中查看http错误状态。是 ubuntu 上的 504 吗?
【解决方案2】:

是的,你是对的,这是因为防火墙设置。但很奇怪。 谢谢,现在一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    • 2017-08-06
    • 1970-01-01
    • 2020-07-19
    • 2020-07-07
    • 2020-06-17
    相关资源
    最近更新 更多