beautypg.com

Chapter 3: the http api, How the http api works, The http api – Adobe Dreamweaver API Reference CS5 User Manual

Page 19: Mmhttp.clearserverscriptsfolder()

background image

14

Last updated 8/27/2013

Chapter 3: The HTTP API

Extensions are not limited to working in the local file system. Adobe® Dreamweaver® provides a mechanism to get
information from and send information to a web server by using hypertext transfer protocol (HTTP). The chapter
describes the HTTP API and how to use it.

How the HTTP API works

All functions in the HTTP API are methods of the

MMHttp

object. Most of these functions take a URL as an argument,

and most return an object. The default port for URL arguments is 80. To specify a port other than 80, append a colon
and the port number to the URL, as shown in the following example:

MMHttp.getText("http://www.myserver.com:8025");

For functions that return an object, the object has two properties:

statusCode

and

data

.

The

statusCode

property indicates the status of the operation; possible values include, but are not limited to, the

following values:

200: Status OK

400: Unintelligible request

404: Requested URL not found

405: Server does not support requested method

500: Unknown server error

503: Server capacity reached

For a comprehensive list of status codes for your server, check with your Internet service provider or system
administrator.

The value of the

data

property varies according to the function; possible values are specified in the individual function

listings.

Functions that return an object also have a callback version. Callback functions let other functions execute while the
web server processes an HTTP request. This capability is useful if you are making multiple HTTP requests from
Dreamweaver. The callback version of a function passes its ID and return value directly to the function that is specified
as its first argument.

The HTTP API

This section details the functions that are methods of the

MMHttp

object.

MMHttp.clearServerScriptsFolder()

Availability
Dreamweaver MX.