Search these areas:
Support Forums
Product Info

DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Data Analysis
Object Model
JavaScript Objects
General Scripting Objects
Data Access Objects
File Access Objects
Http Client Objects
-HttpRequest Object
-HttpResponse Object
-HttpUserAgent Object
Security and Membership Objects
Document Object Model (DOM)
Error Descriptions
Object Model Extensions
Full-Text Search
Domain and Email Hosting
HotBlock Modules
Account Management
New Responsive UI Module

DataWeb Help
Support Forums
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

HttpRequest Object
The HttpRequest Object represents a browser's request to a web server. This object allows developers to formulate complex requests which can be passed to the HttpUserAgent for execution.


[new] HttpRequest([method, url, data, headers]) Creates and returns a new HttpRequest object.


method String value. Specifies the request method. GET and POST are possible values.
url String value. Specifies the URL of the request. The string must either start with http:// or /. If the string starts with /, then the server property of the HttpUserAgent must be set.
data A string or object containing the content of the http request. When an object is used to specify the data parameter, then the name:value pairs in the object will automatically be URL encoded.
headers Object or string. If the header is set with an Object, there is one property for each header. If header is set with a string, the string is a series of name:value pairs separated by '\n'. The default headers are as follows:
Accept: */*
Host: HttpUserAgent.server
Content-Length: (auto)
Connection: Keep-Alive
User-Agent: HttpUserAgent.agent
Content-Type: application/x-www-formurlencoded
The Content-Type header is included if the method parameter is POST, otherwise Content-Type is not specified.

To post XML, set Content-Type to text/xml. If the data parameter includes <?xml, for example, <?xml version="1.0"?>, then Content-Type will automatically be set to text/xml.

Instance Properties

The HttpRequest object has four properties: method, url, data, and headers corresponding to the arguments above.


The following example posts data to the AddressBook data table.

//The HttpRequest object is defined...
     var req = new HttpRequest("POST", "http://myWebSite.");
    var o = new Object;
    o["_redirect"] = "http://myWebSite.";
    o["_table"] = "AddressBook";
    o["_queryargs"] = "_mode=insert";
    o.FirstName = "John";
    o.LastName = "Doe";
    o.Email = ""; = o;

//...then the request is executed 
//with the HttpUserAgent object.
    var resp = HttpUserAgent.request(req);

Related Topics

HttpUserAgent Object, HttpResponse Object

Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us