PHP忽略初始202

I am writing a PHP API Client and the API is written is ASP.net (C#).

I can access the data correctly by using this Javascript function:

    $.ajax({
    type: "POST",
    url: "https://www.eastmidlandstrains.co.uk/services/LiveTrainInfoService.svc/GetLiveBoardJson",
    data: JSON.stringify({
        request: {
            OriginText: "Derby",
            DestText: "Nottingham",
            Departures: true
        }
    }),
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    processdata: true,
    success: function (result) {
        console.log(JSON.parse(result.d));
    },
    error: function (jqXHR, textStatus, errorThrown) {
        console.log('Error: ', errorThrown);
    }
});

I am trying to replicate this request in PHP using Guzzle. So far I have gotten this far:

class EMTClient
{
    const EMT_API_URL = "https://www.eastmidlandstrains.co.uk/services/LiveTrainInfoService.svc/GetLiveBoardJson";

    /**
     * @param string $startLocation
     * @param string $endLocation
     * @return mixed
     */
    public function getJourneys(string $startLocation, string $endLocation)
    {
        $client = new GuzzleHttp\Client();

        $request = new GuzzleHttp\Psr7\Request('POST', self::EMT_API_URL, [
            'json' => json_encode([
                'request' => [
                    'OriginText' => $startLocation,
                    'DestText' => $endLocation,
                    'Departures' => true
                ]
            ]),
            'allow_redirects' => false
        ]);
        $promise = $client->sendAsync($request)->then(function ($response) {
            var_dump($response->getBody());
            return $response;
        });
        $promise->wait();

        return $promise->getBody();
    }
}

The only issue is that this API returns an initial 202 Accepted response before it processes the response and returns the data and the PHP version is catching this 202 and returning the response which is null.

This JS function works perfectly but I need the PHP version, I am also using composer so I can include any PHP libraries.

It seems to me like one version will be setting slightly different Headers that the other is not.

You should check what headers the server expects, and then see what headers are being generated for you PHP vs your JS, and you should ensure these match.

That is the most obvious reason that two identical request would fail.