Archived Forum Post

Index of archived forum posts

Question:

Delphi: How do I set UserAgent with PostUrlEncoded?

Jul 11 '15 at 17:05

How do i set a useragent when I POST data in delphi?

I've set it for doing Get.. but there seems to be no option for PostUrlEncoded..the website I am posting to requires a useragent.

please help


Answer

Does calling the AddHeader method of the HttpRequest object before posting the request work? e.g.

req.AddHeader "User-Agent", "My User Agent Value"

Answer

that worked, thank you