Partager via


HTTPGET

5/10/2007

Syntax

This command opens a session for a specific Web site, initiates access to a remote file for reading, retrieves the file from the server, and then stores it under the specified file name.

Parameters

  • ErrorMode
    Optional. Specified as a decimal representation of a hexadecimal bitmask. Values must be specified in decimal format. The following table shows the possible values.

    Value Name Description

    0 (0xnnnn0000)

    DAERH_ABORT

    Default. The abort-on-error mode stops the command file from processing further.

    32768 (0xnnnn8000)

    DAERH_IGNORE

    The ignore-on-error mode continues by processing the next command when an error occurs.

    32769-33023 (0x000080xx where xx!=00 is the number of retries)

    DAERH_RETRY_WITHIGNORE

    The retry-on-error with ignore mode retries the offending command up to 255 times. If the number of retries exceeds the retry count, this mode continues processing the next command.

    1-255(0x00xx where xx!=0 is the number of retries from 1-255)

    DAERH_RETRY_WITHABORT

    The retry-on-error with abort mode retries the offending command up to 255 times. If the number of retries exceeds the retry count, the command file processing halts.

    65536 – 4294901760(0xFFFFnnnn where FFFF is the delay mask in seconds)

    DAERH_DELAYMASK

    The delay error mode value is added to either the DAERH_RETRY_WITHIGNORE or the DAERH_RETRY_WITHABORT value to cause a delay between retries. This value is in seconds and has a range between 1 and 65535.

    Note

    Parsing errors, especially the passing of not valid command parameters, generates an error in DAERH_ABORT error mode. With logging enabled, an appropriate error message is output to the log file.

  • ExpandMode
    Optional. Specifies if the string that follows it is an environment variable that should be expanded. Can occur multiple times with this command. The following table shows the possible values.

    Value Description

    0

    Does not expand the string.

    1

    Device Update Agent expands the string on the embedded device.

    2

    Device Update Agent script compiler expands the string on the developer computer.

  • Server
    String that contains the host name of an Internet server. Alternately, the string can contain the IP number of the Web site, in ASCII dotted-decimal format, for example, 11.0.1.45.

    Note

    When using HTTPS, the servername listed in the Device Update Script must be identical to the servername listed in the certificate authorization. Use the fully qualified domain name of the server when using HTTPS.

  • RemoteFile
    String that contains the full path name of the file to retrieve from the remote system. The path name is relative to the root directory of the Web server.
  • LocalFile
    String that contains the name of the file to create on the local system.
  • ReplaceFile
    Optional. Boolean that specifies if the function should proceed if a local file of the specified name already exists. The following table shows the possible values.

    Value Name Description

    0

    DANO

    Do not replace.

    1

    DAYES

    Replace.

    2

    DASPECIAL

    Append.

  • ProxyType
    Optional. The following table shows the possible values.

    Value Name Description

    0

    DADEFAULTPROXY

    Retrieves the proxy or direct configuration from the registry and prevents the use of a startup script or Internet setup file.

    1

    DANOPROXY

    Resolves all host names locally.

    3

    DANAMEDPROXY

    Passes requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy.

  • ProxyName
    Optional. String that contains the name of the proxy server(s) to use when proxy access is specified. Do not use an empty string, because it is used as the proxy name. The Win32 Internet functions recognize only CERN-type proxies (HTTP only) and the TIS FTP gateway (FTP only). If Internet Explorer is installed, the Win32 Internet functions also support SOCKS proxies. FTP and gopher requests can be made through a CERN-type proxy either by changing them to an HTTP request or by using the InternetOpenUrl function.
  • ProxyByPassList
    Optional. String that contains an optional list of host names and IP addresses that should not be routed through the proxy. The list can contain wildcards. Do not use an empty string, because the function uses it as the proxy bypass list. If this parameter specifies the "<local>" macro as the only entry, the function bypasses any host name that does not contain a period.
  • Protocol
    Optional. Identifies the transfer or communication protocol. The following table shows the possible values.

    Value Name Description

    0

    DAHTTP

    HTTP protocol

    1

    DAHTTPS

    HTTPS protocol

  • Port
    Optional. Number of the TCP/IP port on the server to connect to. If not specified, 80 is used for HTTP and 443 for HTTPS.
  • ProtocolVersion
    Optional. String that contains the HTTP version. If this parameter is NULL, the function uses HTTP/1.1.
  • Referrer
    Optional. String that specifies the URL of the document from which the URL in the request was obtained. If this parameter is not specified, no referring document is specified.
  • AutologonLevel
    Optional. The following table shows the possible values.

    Value Name

    0

    DAAUTOLOGONMEDIUM

    1

    DAAUTOLOGONLOW

    2

    DAAUTOLOGONHIGH

  • UserName
    Optional. String that contains the name of the user to log on. If the value is NULL, the command uses the default anonymous user name.
  • Password
    Optional. String that contains the password to use to log on. If both Password and UserName are NULL, the command uses the e-mail name of the user as a password. If Password is NULL, but UserName is not NULL, the command uses a blank password.
  • AcceptTypes
    Optional. Array of strings indicating media types accepted by the client computer. The array should be comma-delimited and contain a size parameter specifying the number of accept types. The size parameter should be the first element of the array. The ExpandMode parameter is optional and is used for all accept types. If AcceptTypes is not specified, a server generally interprets this as an indication that the client accepts all media types.

Remarks

For more information, see the Microsoft Windows SDK documentation at this Microsoft Web site.

Example

The following example shows typical use.

//
// HTTPGet
//
HTTPGET,0,0,servername,0,images/myimage.jpg,0,c:\dua\images/myimage.jpg,0,3,0,PROXYNAME,0,<local>,0,80,0,HTTP/1.1,0,ANY,0,0,UserName,0,PassWord,0,3,image
/*,text/*,audio/*

//Using expand modes
HTTPGET,0,1,%server01%,1,%remotefile01%,1,%localfile01%,1,3,1,%proxy%,1,%bypasslist%,0,80,1,%pversion%,1,%refer%,0,1,%user%,1,%pass%,1,3,%accept1%,%accept2%
,%accept3%

See Also

Concepts

DUA Script Command Reference