Link to home
Start Free TrialLog in
Avatar of mrmcop
mrmcop

asked on

NMHTTP : How to define User-Agent string

Hi.

I want to make a function that to get movie info from http://www.imdb.com, then parse and show.

Sample Address Format :

http://us.imdb.com/Tsearch?title=pitch+black&restrict=Movies+and+TV&GO.x=18&
GO.y=8

I can do it by UrlMon library functions (UrlDownloadToFile)but it makes program freze.

I'm using Delphi 5. I haven't Indy Components

NMHTTP component from FastNet group is works well for this. But IMDB WebSite does not like posts which not have USER-AGENT string. Always sends a warning message in html file.

A short example please. It makes me learned it.

I Use NMHTTP like below.

ButtonClick :
  Try    NMHTTP1.Get( Edit1.Text );
  except on ESockError do beep end;

NMHTTP1.onSuccess :
    ListBox1.Items.text := NMHTTP1.Body;
    ParseHTML(ListBox1.Items);


Thanks.
Muharrem ÇÖP (Ankara - Turkey)
mcop@ada.net.tr
ASKER CERTIFIED SOLUTION
Avatar of asymmetric
asymmetric

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial