TraceRequest
Last updated
Was this helpful?
Last updated
Was this helpful?
The TraceRequest
object enables executing HTTP TRACE requests with advanced configuration options. It allows adding custom headers, managing authentication credentials, and handling both synchronous and asynchronous request executions.
For asynchronous requests, success and error callbacks can be defined to process responses or handle errors effectively.
Notable methods include addHeader
, which adds custom headers to the request, and executeRequest
, which performs the TRACE request synchronously. The object also supports asynchronous execution through executeAsyncRequest
, providing flexibility for non-blocking operations. The usePreemptiveAuthentication
method can enable credentials to be sent in the initial request, optimizing performance for specific scenarios.
For broader context on HTTP operations, refer to the documentation.
Add a header to the request.
Execute the request method asynchronous a Promise is returned which will be resolved or rejected when the request is completed or failed.
Execute the request method asynchronous a Promise is returned which will be resolved or rejected when the request is completed or failed.
Execute the request method asynchronous a Promise is returned which will be resolved or rejected when the request is completed or failed.
void
Execute the request method asynchronous.
void
Execute the request method asynchronous using windows authentication.
void
Execute the request method asynchronous.
void
Execute the request method asynchronous using windows authentication.
void
Execute the request method asynchronous.
void
Execute the request method asynchronous using windows authentication.
Execute the request method.
Execute the request method.
Execute a request method using windows authentication.
void
Whatever to use preemptive authentication (sending the credentials in the header, avoiding the server request to the client - useful when uploading files, as some http servers would cancel the first request from the client, if too big, as the authentication request to the client was not yet sent)
Add a header to the request.
Parameters
Sample
Execute the request method asynchronous a Promise is returned which will be resolved or rejected when the request is completed or failed.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out), the Promise is rejected with exception message as the value.
You can use Promise.all([promise1, promise2, promise3]) to wait for multiple promises to complete. A shortcut for this would be to use httpClient.executeRequest(requestArray) that returns 1 promise that is called when all of them are done.
Sample
Execute the request method asynchronous a Promise is returned which will be resolved or rejected when the request is completed or failed.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out), the Promise is rejected with exception message as the value.
You can use Promise.all([promise1, promise2, promise3]) to wait for multiple promises to complete. A shortcut for this would be to use httpClient.executeRequest(requestArray) that returns 1 promise that is called when all of them are done.
Parameters
Sample
Execute the request method asynchronous a Promise is returned which will be resolved or rejected when the request is completed or failed.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out), the Promise is rejected with exception message as the value.
You can use Promise.all([promise1, promise2, promise3]) to wait for multiple promises to complete. A shortcut for this would be to use httpClient.executeRequest(requestArray) that returns 1 promise that is called when all of them are done.
Parameters
Sample
Execute the request method asynchronous. Success callback method will be called when response is received. Response is sent as parameter in callback. This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter.
Parameters
Returns: void
Sample
Execute the request method asynchronous using windows authentication. Success callback method will be called when response is received. Response is sent as parameter in callback followed by any 'callbackExtraArgs' that were given. This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out, network errors), the errorCallbackMethod is called with exception message as parameter followed by any 'callbackExtraArgs' that were given.
Parameters
Returns: void
Sample
Execute the request method asynchronous. Success callback method will be called when response is received. Response is sent as parameter in callback. This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter.
Parameters
Returns: void
Sample
Execute the request method asynchronous using windows authentication. Success callback method will be called when response is received. Response is sent as parameter in callback followed by any 'callbackExtraArgs' that were given. This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out, network errors), the errorCallbackMethod is called with exception message as parameter followed by any 'callbackExtraArgs' that were given.
Parameters
Returns: void
Sample
Execute the request method asynchronous. Success callback method will be called when response is received. Response is sent as parameter in callback. This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter.
Parameters
Returns: void
Sample
Execute the request method asynchronous using windows authentication. Success callback method will be called when response is received. Response is sent as parameter in callback followed by any 'callbackExtraArgs' that were given. This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback. So you need to test the Reponse.getStatusCode() for that to know if everything did go OK. If no response is received (request errors out, network errors), the errorCallbackMethod is called with exception message as parameter followed by any 'callbackExtraArgs' that were given.
Parameters
Returns: void
Sample
Execute the request method.
Sample
Execute the request method.
Parameters
Sample
Execute a request method using windows authentication.
Parameters
Sample
Whatever to use preemptive authentication (sending the credentials in the header, avoiding the server request to the client - useful when uploading files, as some http servers would cancel the first request from the client, if too big, as the authentication request to the client was not yet sent)
Parameters
Returns: void
headerName ;
value ;
Returns: A boolean indicating whether the header was successfully added to the request.
Returns:
username the user name
password the password
Returns:
username the user name
password the password
workstation The workstation the authentication request is originating from.
domain The domain to authenticate within.
Returns:
username the user name
password the password
workstation The workstation the authentication request is originating from.
domain The domain to authenticate within.
successCallbackMethod callbackMethod to be called after response is received
errorCallbackMethod callbackMethod to be called if request errors out
username the user name
password the password
workstation The workstation the authentication request is originating from.
domain The domain to authenticate within.
successCallbackMethod callbackMethod to be called after response is received
errorCallbackMethod callbackMethod to be called if request errors out
callbackExtraArgs extra arguments that will be passed to the callback methods; can be used to identify from which request the response arrived when using the same callback method for multiple requests. Please use only simple JSON arguments (primitive types or array/objects of primitive types)
username the user name
password the password
successCallbackMethod callbackMethod to be called after response is received
errorCallbackMethod callbackMethod to be called if request errors out
username the user name
password the password
successCallbackMethod callbackMethod to be called after response is received
errorCallbackMethod callbackMethod to be called if request errors out
callbackExtraArgs extra arguments that will be passed to the callback methods; can be used to identify from which request the response arrived when using the same callback method for multiple requests. Please use only simple JSON arguments (primitive types or array/objects of primitive types)
successCallbackMethod callbackMethod to be called after response is received
errorCallbackMethod callbackMethod to be called if request errors out
successCallbackMethod callbackMethod to be called after response is received
errorCallbackMethod callbackMethod to be called if request errors out
callbackExtraArgs extra arguments that will be passed to the callback methods; can be used to identify from which request the response arrived when using the same callback method for multiple requests. Please use only simple JSON arguments (primitive types or array/objects of primitive types)
Returns: A Response object containing the result of the executed HTTP request.
userName the user name
password the password
Returns: A Response object containing the result of the HTTP request, authenticated with the provided username and password.
userName the user name
password the password
workstation The workstation the authentication request is originating from.
domain The domain to authenticate within.
Returns: A Response object containing the result of the HTTP request, authenticated using Windows authentication with the provided credentials.
b ;