If Corda Server™ knows what Web browser a client is using, it can return optimized (i.e., shorter and without Javascript*) HTML for embedding the Corda® image. To use this feature, you must pass the appropriate information to Corda Embedder using the userAgent attribute. For example:
myImage.userAgent = request.getHeader("USER-AGENT");
Set the userAgent attribute to the value of the HTTP User Agent environment variable. How you access this variable depends on the programming environment. This section lists the appropriate procedure for some common programming environments.
Important: It is not necessary to tell Corda Embedder the client's user agent, but you cannot take advantage of optimized HTML without doing so.
To access the HTTP User Agent environment variable in ASP, use the following:
myImage.userAgent = Request.ServerVariables("HTTP_USER_AGENT")
To access the HTTP User Agent environment variable in ASP.NET, use the following:
C# myImage.userAgent = Request.UserAgent;
Visual Basic myImage.userAgent = Request.UserAgent
To access the HTTP User Agent environment variable in ColdFusion*, use the following:
myImage.userAgent = Request.ServerVariables("HTTP_USER_AGENT");
To access the HTTP User Agent environment variable with Java* Corda Embedder, use the following:
myImage.userAgent = request.getHeader("USER-AGENT");
To access the HTTP User Agent environment variable with Java Corda Embedder, use the following:
myImage.userAgent = request.getHeader("USER-AGENT");
Accessing the HTTP User Agent in PERL varies by platform. In Windows*, for example, access it with the following:
$myImage->userAgent($ENV{'HTTP_USER_AGENT'});
To access the HTTP User Agent environment variable with PHP, use the following:
$myImage->userAgent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];