swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

HttpRequestSetProxy

 
 

Library: Net, HTTP support (OMHTTP)
Include: omhttp.xin

Declaration

  define function HttpRequestSetProxy
              modifiable  stream   Request
     host     value       stream   Host
     port     value       integer  Port optional initial { 80 }

Argument definitions

Request
is an HTTP request object.
Host
is the URL of the proxy server
Port
is the port number on the proxy server to which you will be sending requests


Purpose

Use HttpRequestSetProxy to set the proxy server to be used for an HTTP request.

Requirements

You must include the following line at the beginning of your OmniMark program:


  include "omhttp.xin"

You must create an HTTP request with HttpRequestSetFromUrl

Usage Notes

After you use HttpRequestSetProxy, you can send a request with HttpRequestSend.

Example

The following program requests the OmniMark home page via a proxy server. You should set the appropriate values of proxy-server and proxy-port for the proxy server you are using.

  include "omhttp.xin"

  global HttpRequest Request
  global HttpResponse Response global stream proxy-server initial {"proxy.mycompany.com"}
  global integer proxy-port initial {80}

  process

      HttpRequestSetFromUrl Request from "www.omnimark.com:80"
      HttpRequestSetProxy Request host proxy-server port proxy-port

      HttpRequestSend Request into Response
      do unless HttpObjectIsInError Request
          output "%n<response>%n"
          repeat over Response
              output key of Response
                  || " = "
                  || Response || "%n"
          again
      else
          local stream Report variable
          HttpObjectGetStatusReport Request into Report
          output "%n<request failed>%n"
          repeat over Report
              output Report || "%n"
          again
      done

    Related Syntax
   HttpRequestSend
   HttpRequestSetFromUrl
 
  Other Library Functions
   HttpConnectionSendResponse
   HttpLibraryVersion
   HttpObjectGetCookieAttributes
   HttpObjectGetCookieValues
   HttpObjectGetHeaders
   HttpObjectGetStatusReport
   HttpObjectIsInError
   HttpObjectSetCookieAttribute
   HttpObjectSetCookieValue
   HttpObjectSetHeader
   HttpRequest
   HttpRequestGetSearchItems
   HttpRequestSend
   HttpRequestSetFromUrl
   HttpRequestSetProxy
   HttpRequestSetSearchItem
   HttpResponse
   HttpResponseOutput
   HttpServiceAwaitRequest
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:19 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.