Desktop Agent (MacOS) throwing 400 Bad Request but web agent seems ok

Hi all,

I’m new to Postman, I find it very powerful and I love it.

I found a problem when using Desktop Agent. When I make the same POST request with both Web Agent & Desktop Agent, Desktop Agent always throw me an error (400 Bad Request).

The Header & Body are exactly same between Web & Desktop Agent. Please refer to the screenshot below:

Here’s the payload of the body that’s being sent, nothing seems wrong:

{
    "users": [
        {
            "identifiers": {
                "email": "kahchon@telegmail.com"
            },
            "events": [
                {
                    "event_name": "purchase",
                    "timestamp": "2019-10-10T14:00:00Z",
                    "event_params": {
                        "product_id": "2100",
                        "unit_price": 99.00,
                        "unit_sale_price": 99.00,
                        "event_group_id": "test19",
                        "currency": "MYR"
                    }
                }
            ]
        }
    ]
}

I have tried googling around but I can’t find anyone that have similar problem as mine. Please advice.

When you send the request using the web client, it sends it from a Postman IP address over the Internet.

When you send the request from the desktop client, it sends it from the IP address of the device where you have the desktop client installed. If behind a corporate firewall, it will be the external IP address of your firewall.

The 400 bad request seems to be coming from Cloudflare.

Is your API hidden behind a Cloudflare proxy or is this an internal proxy\firewall that is blocking the request. If behind a corporate firewall, you may need to ask your networks team to allow access.

Hi Mdjones,

Thank you for the reply. Based on my findings, I’m pretty sure that there is nothing to do with firewall, I have tried using both my Office & Home networks, the result are the same (400 Bad Request).

However, when I try to use my Mac Terminal to cURL the same query (which is the same network), it works with no issue (200 Ok)…

And even when I’m using Web Agent, I set it to “Browser Agent”, which I assume it will be using my local IP on the device too, and it works as well.

I suspect the desktop agent has some sort of proxy setup behind? I install it from fresh, and I didn’t alter any proxy settings.

Hi @sochun2424

Is it a corporate laptop?

I found on mine that web would work but the client would not.
Turned out to be changes to the corporate proxy that blocked the client (but not web).
I had to add a self-sign certificate to Postman, for my corporate proxy.

hi @w4dd325,

I’m using my own laptop without any device management policy set on my computer.

But it seems fine when I fire the API using Mac Terminal (cURL), so I’m quite sure that it is not because of firewall or some sort.

I don’t think it’s a local issue. Like a local firewall on the MAC.

It does look like a networking issue with the request being rejected by Cloudflare.

I don’t know how Cloudflare sits in the infrastructure of your API that you are trying to post to.

Cloudflare is used for various reasons including denial of service protection, where you usually have to complete a captcha before you can actually hit the website. Wondering if the desktop app is triggering some extra level of protection, where you might need to add some additional authorisation or headers to bypass.