public < Result > Result submitRequest ( TDApiRequest apiRequest , Optional < String > apiKeyCache , TDHttpRequestHandler < Result > handler ) throws TDClientException { RequestContext requestContext = new RequestContext ( config , apiRequest , apiKeyCache ) ; try { return submitRequest ( requestContext , handler ) ; } catch ( InterruptedException e ) { logger . warn ( "API request interrupted" , e ) ; throw new TDClientInterruptedException ( e ) ; } catch ( TDClientException e ) { throw e ; } catch ( Exception e ) { throw new TDClientException ( INVALID_JSON_RESPONSE , e ) ; } }
A low - level method to submit a TD API request .