Learn R Programming

httpRequest (version 0.0.3)

PostToHost: Sends Multiform Post Request to HTTP Server

Description

Sends Multiform Post Request to HTTP Server

Usage

PostToHost(host,path,dataTosend,referer="",port=80)

Arguments

host
The host to which to send the Request eg.: www.spiegel.de,127.0.01
path
The path to the file eg. /cgi/getpasswords.pl or /index.html
dataTosend
its a list of name value pairs e.g. list(name=value,name1=value1,name2=value2)
referer
something like www.myhome.org
port
its 80 or 8080 most frequently

Value

  • The document which the server returns as a string.

Details

It is a simple http client. So it does not take care of special chars e.g. whitspaces. For details see e.g. perl HTTP::Request::Common documentation. and http://www.w3.org/Protocols/rfc1341/0_TableOfContents.html

Examples

Run this code
port <- 80
test2 <- list(
            "fruit"="apple"
           ,"dat_defs"="20021204/F113213.dat"
           ,"upsa"="test"
           )
           print(test2)
#PostToHost("127.0.0.1","/cgi-bin/param_list.pl",test2,referer="www.test.de",port=port)
#for sample code look in the help directory of the package

Run the code above in your browser using DataLab