Event that occurs before any web service request is made to the server to allow the user to add or modify headers.
Object.defineProperty(WebServiceCall, 'prepareWebServiceCall',
get: function(),
set: function(value)
)
static prepareWebServiceCall: LeadEvent;
A user can add a handler to this event, which will fire before every web service request the Leadtools.Controls.Medical.js
library makes.
For example, this event is fired from a resulting web service call from setting the MRTIImage.ImageUri property to a URI.
The event data is of type PrepareWebServiceCallEventArgs.
Assign the headersObject a javascript object representing any headers that are to be added/modified to the web.
As an example, this event can be used to add an authorization bearer token by doing the following:
Add this line of code to your code (for example at the end of app.run
in MedicalViewerDemo.js
).
lt.Controls.Medical.WebServiceCall.add_prepareWebServiceCall(myWebServicePreparationHandler);
Define this function
function myWebServicePreparationHandler(args) {
args.headersObject = { 'Authorization': 'Bearer MY_BEARER_TOKEN' };
args.cancel = false;
}
The following is a second example that adds two headers to the web service call:
function myWebServicePreparationHandler(args) {
args.headersObject = {
'Content-Type': 'application/terry',
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
Member | Value |
---|---|
sourceClass | Name of the class making the request. For example, this will be MRTIImage for MRTIImage.imageUri. |
sourceMethod | Name of the method making the request. For instance, this will be imageUri for MRTIImage.imageUri. |
cancel | Can be set to true by the event handler to cause the request to return immediately. |
serviceCall | A string which contains the full path and all parameters of the service call. For example, serviceCall might contain the value "http://localhost/MedicalViewerServiceAsp23/api/retrieve/GetImageTile?auth=BXRlcnJ56bBNY2Nu3Ej%2B%2F%2F8PAAA%3D&instance=1.2.840.114257.3.6.5.5.18900282&frame=0&x=768&y=256&w=42&h=120&xr=810&yr=376&wldata=true" |
headersObject | This is a JavaScript object that contains zero or more properties, where each property is a key-value pair. These pairs represent the headers of a web service call. Keys are strings that represent the header names, and values are strings that represent the header content. This object is used to configure the HTTP headers sent in any web service request, facilitating the communication of additional information such as content types, authentication tokens, and other metadata required by the server. |
Leadtools.Controls.Medical Namespace
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document