Author Topic: Help with http request  (Read 5572 times)

Offline nickels

  • Junior Member
  • **
  • Posts: 13
    • View Profile
Help with http request
« on: July 09, 2006, 11:35:55 PM »
I wonder if anyone can help here.

I currently have an Access database setup to download the ICE XML file using webget, and parse it using the ChilkatXml COM add in.

I have just noticed that this COM-addin has a "httpget" method, which is probably a better way of  getting the data rather than using
Code: [Select]
shell webget.exe [address of xml file], as the shell command in VBA executes asynchronously and sometimes the file has not downloaded before I wish to proceed with the next program step.

Trouble is, I can plug in the http address but how do I put in user name and password without having to enter it at runtime? The documentation only has the parameters
Code: [Select]
&start_date=<date>; · &end_date=<date> · &late_mod=<last modified time>; · &no_programs=1 etc. Are there other parameters that can be added to this cgi? (I think that it should be
Code: [Select]
last_mod shouldn't it?)

Any help appreciated!

NICK
« Last Edit: July 09, 2006, 11:37:41 PM by nickels »

Offline Russell at IceTV

  • Guru
  • *****
  • Posts: 444
    • View Profile
Re: Help with http request
« Reply #1 on: July 10, 2006, 07:31:31 AM »
Hi Nick,

Yes, it should indeed be "&last_mod=<last modified time>".  Definite typo there, we'll take care of it -- sorry about that.  There are also two more parameters missing from that page:

&days=<number of days>
&channels=<comma-delimited channel ID list>

The original documentation page is here:  http://iceguide.icetv.com.au/cgi-bin/epg/iceguide.cgi?op=help

But to answer your original question of how to include the username and password...  That's something that's specific to whatever program you're using to download the file.  Webget.exe allows you to add "-u <username" and "-p <password" to the command line.  But you'll have to find out how to include those parameters with your program.  What you're looking for is a way to authenticate directly with the web server through HTTP.  But I'm afraid I'm not familiar with that program so I'm not sure how to do it.

Good luck,
Russell

Offline BJReplay

  • Full Member
  • ***
  • Posts: 57
    • View Profile
Re: Help with http request
« Reply #2 on: July 10, 2006, 09:06:53 AM »
The standard form is
Code: [Select]
http://userid:password@www.anywhere.com/Whether and how your component handles this is another issue.  If you build your URL and plug in your userid and password into it, internet explorer (for example) will handle the authentication correctly and you're away.

Offline Russell at IceTV

  • Guru
  • *****
  • Posts: 444
    • View Profile
Re: Help with http request
« Reply #3 on: July 10, 2006, 11:25:45 AM »
Does that method still work in the latest versions of IE?  I'm pretty sure there was a Microsoft patch a couple of years back that disabled that, because of some security risk.  But it may still be the way third party programs do it, I'm not sure.

Russell

Offline BJReplay

  • Full Member
  • ***
  • Posts: 57
    • View Profile
Re: Help with http request
« Reply #4 on: July 10, 2006, 11:41:57 AM »
Hmmm, not sure.

Definitely still works with ftp in IE.

As far as I know it is part of the RFC: http://www.gbiv.com/protocols/uri/rfc/rfc3986.html#userinfo, although noted as deprecated.

Offline nickels

  • Junior Member
  • **
  • Posts: 13
    • View Profile
Re: Help with http request
« Reply #5 on: July 11, 2006, 12:48:48 AM »
Thanks for that. I tried the
Code: [Select]
http://username:password@iceguide... format using Firefox and it gets the file no worries. I'll plug it into my code in the next day or so and report back.

Cheers

NICK

EDIT 11/7

Yes, that worked in code as well: the httpget method of this com-addin is synchronous so the whole thing will work unattended if necessary.

I just checked the RFC for the URI: it appears that the usage username:password@domain is deprecated (for the obvious reason that in a get request the password would be visible to the user. That's not an issue for me as the user will never see the username or password.).
« Last Edit: July 11, 2006, 11:28:19 PM by nickels »


Share via facebook Share via twitter

xx
Help! The McMafia have stolen our apostrophe!

Started by prl on IceTV EPG Content

2 Replies
254 Views
Last post February 08, 2019, 12:18:06 PM
by prl
xx
2 tuner epg help

Started by Maxicat2003 on Humax

0 Replies
1264 Views
Last post June 27, 2017, 10:23:07 PM
by Maxicat2003
clip
iPhone app help

Started by GXK on Smart Recording on iPhone/iPod Touch/iPad

0 Replies
935 Views
Last post June 23, 2017, 08:51:54 PM
by GXK
xx
Help me please

Started by skruffy on General Discussions

0 Replies
961 Views
Last post November 16, 2016, 08:12:49 AM
by skruffy