Board index » delphi » HTTP Thicky needs help with Indy HTTP client

HTTP Thicky needs help with Indy HTTP client

Hi,

Im trying to set up the properties in a TIdHTTP client control according to
a specification Ive got from a website to set up a dynamic dns update.
The spec for the HTTP Get request is as follows
"GET
/nic/update?system=statdns&hostname=yourhost.ourdomain.ext,yourhost2.dyndns.
org &myip=ipaddress&wildcard=OFF&mx=mail.exchanger.ext&backmx=NO&offline=NO
HTTP/1.1
Host: members.dyndns.org
Authorization: Basic username:pass (note: username:pass must be encoded in
base64)
User-Agent: myclient/1.0 m...@null.net"

Of course, the values are user specific eg hostname, myip etc.

Im using the Indy 9 components. First thought was "look at the demos". The
demo is indy8 specific, properties no longer exist and it wont compile.Aside
from this, the demo only sets a couple of obvious request properties that
even I can work out, and adds lots of other stuff I dont need.
So I pressed f1 in  the "request" field of the object inspector. This showed
me an object that isnt the same as what I wanted info on.

Im confused knowing nothing about how to use the control and nothing about
http in general.

How on earth do I split the above up and where do the bits go?

1)When I call Get method, what do I use for the URL parameter?
2)Where do I put the /nic/update? and do I use the "?" somewhere?
3)The various fields like "system" and "hostname" - where do I add these?
and do I have to add the "&" to the string?
4)Does the Host: field go in TIdHTTP.Host or TIdHTTP.request.host ?
5)I assume I use the BasicAuthentication property set to true and add values
for Username and Password properties and encode those into base64 first.

--
Clairebear

http://www.corkyscave.com

2.0.0 Beardies, 1.1.0 Garter, 0.0.2 Corn, 1.0.0 Pueblan Milk, 1.0.0 Cali
King, 1.2.0 Red tail, 1.1.0 Hogg Island, 1.0.0 Royal, 1.1.0 Borneo {*word*76},
1.1.0 Carpet, 1.1.0 Western Hognose, 1.0.0 Burmese

http://www.faqs.org/faqs/usenet/emily-postnews/part1/

 

Re:HTTP Thicky needs help with Indy HTTP client


IdHTTP1.Request.UserName := 'yourusername';
IdHTTP1.Request.Password := 'yourpassword';
IdHTTP1.Request.UserAgent := myclient/1.0 m...@null.net"
Get('http://members.dyndns.org/nic/update?system=statdns&hostname=yourhost.o
urdomain.ext,yourhost2.dyndns.org&myip=ipaddress&wildcard=OFF&mx=mail.exchan
ger.ext&backmx=NO&offline=NO');

You have to contstruct your Get URL before passing it to the http
componenet.

--
Doychin Bondzhev - Team Indy
docy...@dsoft-bg.com

Quote
"Clairebear" <nospam_clairebea...@ntlworld.com> wrote in message

news:3cafefa5$1_1@dnews...
Quote
> Hi,

> Im trying to set up the properties in a TIdHTTP client control according
to
> a specification Ive got from a website to set up a dynamic dns update.
> The spec for the HTTP Get request is as follows
> "GET

/nic/update?system=statdns&hostname=yourhost.ourdomain.ext,yourhost2.dyndns.
Quote
> org

&myip=ipaddress&wildcard=OFF&mx=mail.exchanger.ext&backmx=NO&offline=NO
Quote
> HTTP/1.1
> Host: members.dyndns.org
> Authorization: Basic username:pass (note: username:pass must be encoded in
> base64)
> User-Agent: myclient/1.0 m...@null.net"

> Of course, the values are user specific eg hostname, myip etc.

> Im using the Indy 9 components. First thought was "look at the demos". The
> demo is indy8 specific, properties no longer exist and it wont
compile.Aside
> from this, the demo only sets a couple of obvious request properties that
> even I can work out, and adds lots of other stuff I dont need.
> So I pressed f1 in  the "request" field of the object inspector. This
showed
> me an object that isnt the same as what I wanted info on.

> Im confused knowing nothing about how to use the control and nothing about
> http in general.

> How on earth do I split the above up and where do the bits go?

> 1)When I call Get method, what do I use for the URL parameter?
> 2)Where do I put the /nic/update? and do I use the "?" somewhere?
> 3)The various fields like "system" and "hostname" - where do I add these?
> and do I have to add the "&" to the string?
> 4)Does the Host: field go in TIdHTTP.Host or TIdHTTP.request.host ?
> 5)I assume I use the BasicAuthentication property set to true and add
values
> for Username and Password properties and encode those into base64 first.

> --
> Clairebear

> http://www.corkyscave.com

> 2.0.0 Beardies, 1.1.0 Garter, 0.0.2 Corn, 1.0.0 Pueblan Milk, 1.0.0 Cali
> King, 1.2.0 Red tail, 1.1.0 Hogg Island, 1.0.0 Royal, 1.1.0 Borneo {*word*76},
> 1.1.0 Carpet, 1.1.0 Western Hognose, 1.0.0 Burmese

> http://www.faqs.org/faqs/usenet/emily-postnews/part1/

Re:HTTP Thicky needs help with Indy HTTP client


It's worked !!!
That's brilliant. Many thanks Doychin :o)

--
Clairebear

http://www.corkyscave.com

2.0.0 Beardies, 1.1.0 Garter, 0.0.2 Corn, 1.0.0 Pueblan Milk, 1.0.0 Cali
King, 1.2.0 Red tail, 1.1.0 Hogg Island, 1.0.0 Royal, 1.1.0 Borneo {*word*76},
1.1.0 Carpet, 1.1.0 Western Hognose, 1.0.0 Burmese

http://www.faqs.org/faqs/usenet/emily-postnews/part1/

"Doychin Bondzhev - Team Indy" <doyc...@dsoft-bg.com> wrote in message
news:3cb00052_1@dnews...

Quote
> You have to contstruct your Get URL before passing it to the http
> componenet.

> --
> Doychin Bondzhev - Team Indy
> docy...@dsoft-bg.com

Other Threads