Skip to Content
0
Jan 09, 2023 at 01:47 PM

SAP BTP SDK OData - Sync vs. Async HTTP calls - how to make Async HTTP GET requests

384 Views Last edit Jan 09, 2023 at 01:50 PM 2 rev

During our development of an iOS application utilising the SAP BTP SDK, we've noticed that when we fetch multiple pieces of data, the HTTP-calls to SAP is executed by SAP sequentially. That means, if we from our iOS app send 6 HTTP GET requests, the calls will be executed in a first in first completed fashion. If each call takes a second to execute by SAP, then all calls will take 6 seconds to complete.

As such this is 'fine' if one was POST'ing data, or in some way editing data, but since a huge amount of the calls we do is GET calls, we in many cases end-up waiting 30-45 seconds before we have the data at hand.

We've monitored this behaviour with a HTTP proxy, in order to see the calls made by the iOS app. So the behaviour seems to be with the SAP and not the iOS app.

I've tried to search around to see if we can add some header parameter or similar to our SAP-functions.

Is there anything we can change or set on either the SAPURLSession, HTTPHeaders, OnlineDataService or similar, that will make it possible for HTTP calls to be run asynchronously instead of synchronously?