Public Member Functions | Public Attributes | List of all members
XMLHttpRequest Class Reference

Inherits ScriptObject.

Public Member Functions

 XMLHttpRequest ()
 
 open (String method, String url, Boolean async, String user, String password)
 
 abort ()
 
 setRequestHeader (String name, String value)
 
 send (String data)
 
String getResponseHeader (String name)
 

Public Attributes

String response
 The request response.
 
String responseXML
 Not supported.
 
Integer status
 The status.
 
String statusText
 The status text.
 

Detailed Description

XMLHttpRequest support.

Security: Requires security level 0.

var request = XMLHttpRequest();
request.open("GET", "https://autodesk.com", false, "", "");
request.send(null);
log(request.response);
Since
41366

Constructor & Destructor Documentation

◆ XMLHttpRequest()

Constructs an XMLHttpRequest object.

Member Function Documentation

◆ abort()

abort ( )

Aborts the request.

◆ getResponseHeader()

String getResponseHeader ( String  name)

Returns the value of response header field. Returns an empty string if the requested header field is not present or empty in the response

Parameters
nameThe name of the header field. Precondition: open() and send() called

◆ open()

open ( String  method,
String  url,
Boolean  async,
String  user,
String  password 
)

Initializes the request.

Parameters
methodThe request method.
urlThe connection url.
asyncTrue for asynchronous. Not supported.
userThe user.
passwordThe password.

◆ send()

send ( String  data)

Sends the request.

Parameters
dataThe request body data.(unused for a GET request)

◆ setRequestHeader()

setRequestHeader ( String  name,
String  value 
)

Sets the value of request header field. Must be called before send(). If the header field already exists, the value will be appended to the previous value.

Parameters
nameThe name of the header field.
valueThe value of the header field.


Generated by Autodesk, Inc. 19 April 2024
Copyright (c) 2012-2024 by Autodesk, Inc.