Class Index | File Index

Classes


Class atropa.Requester


Version 20130311.
This represents an XMLHttpRequest.
Defined in: <node_modules/atropa-Requester/src/atropa-Requester.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
This represents an XMLHttpRequest.
Field Summary
Field Attributes Field Name and Description
 
Object whose properties and values are header names and values respectively.
 
Set the timeout value for the request in milliseconds.
Method Summary
Method Attributes Method Name and Description
 
makeRequest(method, url, messageBody, callback)
Makes an AJAX request.
Class Detail
atropa.Requester()
This represents an XMLHttpRequest.
Author: Matthew Christopher Kastor-Inare III
☭ Hial Atropa!! ☭.
var requester, formData;

requester = new atropa.Requester();
requester.timeout = 10000; // requests will abort after 10 seconds.
requester.requestHeaders = {
    "aHeader" : "headerValue",
    "anotherHeader" : "andValue"
};

function showRequestResults(status, request) {
    console.log("Status: ' + status);
    console.dir(request); // console dir may or may not
                       // be supported in your environment.
}

formData = new FormData();
formData.append('aFormFieldName', 'formFieldData');
formData.append('anotherFormFieldName', 'andData');

requester.makeRequest(
    "post", "http://example.com", formData, showRequestResults);
Returns:
{Requester} Returns a requester object.
Requires:
atropa.ArgsInfo#checkArgTypes
Field Detail
{Object} requestHeaders
Object whose properties and values are header names and values respectively.

{Number} timeout
Set the timeout value for the request in milliseconds. The request will abort after this amount of time has passed.
Method Detail
makeRequest(method, url, messageBody, callback)
Makes an AJAX request.
Author: Matthew Christopher Kastor-Inare III
☭ Hial Atropa!! ☭.
Parameters:
{String} method
The HTTP method to be used for this request.
{String} url
The URL to send the request to.
{String} messageBody
The body of the request.
{Object} callback
The callback function to execute when readyState is 4. The callback is supplied with two arguments. The first argument is a boolean indicating whether or not the http status was 200. The second argument is the request object.
Throws:
atropa.Requester.makeRequest unexpected argument type

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Nov 17 2022 14:29:55 GMT-0500 (Eastern Standard Time)