troubleshooting Question

NMHTTP : How to define User-Agent string

Avatar of mrmcop
mrmcop asked on
Delphi
1 Comment1 Solution749 ViewsLast Modified:
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
asymmetric

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros