sowaputils-0.1.1

Chandrashekhar Mullaparthi Chandrashekhar.Mullaparthi@REDACTED
Tue Nov 13 14:45:26 CET 2001


Read the source!!! I expanded on the comments in the source code after using
this.

%%request_sync(Method, HTTPReq)
%%Method = atom. get/put/post etc.
%%HTTPReq = {URL, Headers, ContentType, Body} | {Url, Headers}
%%          URL = string
%%          Headers = [{Key, Value} | ...]
%%          Key = atom | list
%%          Value = list
%%          ContentType = list
%%          Body = list

%%request_sync(Method, HTTPReq, Settings)
%%Settings = [Setting]
%%           Setting = timeout | {timeout, Val}                       
%%           Val = integer
%%           If only timeout is specified, the default value of 5000 ms is
used.
%%request(Ref, Method, HTTPCont, Timeout)
%%Ref = any erlang term
%%Timeout = integer
%%    Spawns a process for each HTTP request and sends caller the message:
%%    {Ref,{Status,Headers,ContentType,Body}}
%%    whenever the reply comes back from the HTTP server 

7> http:request_sync(get, {"http://bruce:4567/index.html", []}).
{ok,{200,
     [{date,"Tue, 13 Nov 2001 13:41:07 GMT"},
      {server,"inets/2.5.6"},
      {connection,"close"},
      {'last-modified',"Fri, 27 Jul 2001 14:10:27 GMT"},
      {'content-length',"202"}],
     "text/html",
     "<HTML>\n  <HEAD>\n    <TITLE>Welcome SMS - O&M\n    </TITLE>\n
</HEAD>\n
 <FRAMESET COLS=\"150,*\">\n\t<FRAME SRC=\"left.html\" NAME=\"toc\"
noresize>\n\
t<FRAME SRC=\"title.html\" NAME=\"my_data\">\n  </FRAMESET>\n</HTML>\n"}}

It does have support for using a proxy server but I didn't need it so didn't
bother digging around. In the Headers field - you can include {Key,Value}
pairs for accessing password protected pages by specifying {"Authorization",
"Basic: <base64 encoded username:password>"}.

cheers,
Chandru

> -----Original Message-----
> From: Tanja Godau [mailto:eedtag@REDACTED]
> Sent: 13 November 2001 13:28
> To: erlang-questions@REDACTED
> Cc: eedtag@REDACTED
> Subject: sowaputils-0.1.1
> 
> 
> Hello Erlang Enthusiasts,
> 
> Does anybody know of documentation relating 
> to the HTTP/1.1 client contained in sowaputils-0.1.1?
> (part of the SO WAP! project)
> 
> Has anyone got examples of how to work with the HTTP/1.1
> element of this module?
> 
> yours sincerely
> Tanja Godau
> 
> 
> Tanja Godau
> Software Designer
> Ericsson Eurolab Deutschland GmbH
> Verification Tool Design
> 
> Tel: +49 2407 575 310 
> Fax: +49 2407 575 651
> Dect:+49 2407 575 89427
> mailto:Tanja.Godau@REDACTED
> 
> 



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.




More information about the erlang-questions mailing list