Alaska Software Inc. - LoadfromURL to execute a "POST"
Username: Password:
AuthorTopic: LoadfromURL to execute a "POST"
Jim GrahamLoadfromURL to execute a "POST"
on Tue, 16 Sep 2008 10:35:20 -0400
Hi,

I am trying to use the LoadFromURL function to execute a "POST" function on 
an SMS Server device at my desk.

The result of the "POST" is supposed to return SMS messages stored in the 
buffer of the device.

I have not been able to get the API to work because I do not know enough 
about constructing "POST" requests and the documentation sucks:

4.1 HTTP Receive API

Configuration of the "Receive API" Using the SMSFinder Web Admin Interface

When the protocol is HTTP, the "Receive API request" is an HTTP POST packet.

4.1.1 POST Packet Format With Authentication

POST /cgi-bin/postquery.cgi HTTP/1.1

HOST: 192.168.2.2:80

User-Agent: SMSFinder/1.20

Accept: text/xml, application/xml,

application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,

application/msword, application/vnd.ms-powerpoint, image/png, */*

Accept-Language: en-us; en;q=0.50

Accept-Encoding: gzip, deflate

Accept-Charset: ISO-8859-1, utf-8;q=0.7, *;q=0.7

Keep-Alive: 300

Connection: keep-alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 395

username=SMSFINDER&password=SMSFINDER&XMLDATA=%3C%3Fxml%20version%3

D%221.0%22%20encoding%3D%22ISO-8859-

1%22%3F%3E%0D%0A%3CMessage%20Notification%3E%0D%0A%3CSenderNumber%3

E%2B919844895692%3C%2FSenderNumber%3E%0D%0A%3CDate%3E08%2F03%2F14

%3C%2FDate%3E%0D%0A%3CTime%3E12%3A53%3A09%3C%2FTime%3E%0D%0A%3

CMessage%3ETest%0D%0A%0D%3C%2FMessage%3E%0D%0A%3C%2FMessage%20N

otification%3E%0D%0A


I do not know how I would construct the above transaction to provide to the 
LoadFromURL()

   I assume that the lcForm variable should be a form that represents the 
above data?

  Does the lcURL variable have to have a reference to the CGI application: 
/cgi-bin/postquery.cgi ??

   lcResponse := LoadFromUrl( lcUrl, Nil,Nil,Nil,Nil,"POST",lcForm )

Any help appreciated.


Jim Graham
Vice President
Professional Teledata
175 Canal Street
Manchester, NH 03101
800.344.9944
www.proteledata.com
Jim GrahamRe: LoadfromURL to execute a "POST"
on Tue, 16 Sep 2008 15:19:54 -0400
No response needed, I misunderstood the documentation.


"Jim Graham" <j.graham@proteledata_dot_com> wrote in message 
news:6cab0ecf$716919a0$465@news.alaska-software.com...
> Hi,
>
> I am trying to use the LoadFromURL function to execute a "POST" function 
> on an SMS Server device at my desk.
>
> The result of the "POST" is supposed to return SMS messages stored in the 
> buffer of the device.
>
> I have not been able to get the API to work because I do not know enough 
> about constructing "POST" requests and the documentation sucks:
>
> 4.1 HTTP Receive API
>
> Configuration of the "Receive API" Using the SMSFinder Web Admin Interface
>
> When the protocol is HTTP, the "Receive API request" is an HTTP POST 
> packet.
>
> 4.1.1 POST Packet Format With Authentication
>
> POST /cgi-bin/postquery.cgi HTTP/1.1
>
> HOST: 192.168.2.2:80
>
> User-Agent: SMSFinder/1.20
>
> Accept: text/xml, application/xml,
>
> application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,
>
> application/msword, application/vnd.ms-powerpoint, image/png, */*
>
> Accept-Language: en-us; en;q=0.50
>
> Accept-Encoding: gzip, deflate
>
> Accept-Charset: ISO-8859-1, utf-8;q=0.7, *;q=0.7
>
> Keep-Alive: 300
>
> Connection: keep-alive
>
> Content-Type: application/x-www-form-urlencoded
>
> Content-Length: 395
>
> username=SMSFINDER&password=SMSFINDER&XMLDATA=%3C%3Fxml%20version%3
>
> D%221.0%22%20encoding%3D%22ISO-8859-
>
> 1%22%3F%3E%0D%0A%3CMessage%20Notification%3E%0D%0A%3CSenderNumber%3
>
> E%2B919844895692%3C%2FSenderNumber%3E%0D%0A%3CDate%3E08%2F03%2F14
>
> %3C%2FDate%3E%0D%0A%3CTime%3E12%3A53%3A09%3C%2FTime%3E%0D%0A%3
>
> CMessage%3ETest%0D%0A%0D%3C%2FMessage%3E%0D%0A%3C%2FMessage%20N
>
> otification%3E%0D%0A
>
>
> I do not know how I would construct the above transaction to provide to 
> the LoadFromURL()
>
>   I assume that the lcForm variable should be a form that represents the 
> above data?
>
>  Does the lcURL variable have to have a reference to the CGI application: 
> /cgi-bin/postquery.cgi ??
>
>   lcResponse := LoadFromUrl( lcUrl, Nil,Nil,Nil,Nil,"POST",lcForm )
>
> Any help appreciated.
>
>
> -- 
> Jim Graham
> Vice President
> Professional Teledata
> 175 Canal Street
> Manchester, NH 03101
> 800.344.9944
> www.proteledata.com
>