login about faq

I'm using the VB.Net 4 DLL (9.5.0.54) and when posting to a PHP page set to output the User-Agent, this is always blank.

I have tried using AddHeader on the request (HttpRequest), UserAgent on the HTTP object and SetRequestHeader on the HTTP object all without success.

I have also tried upgrading to the latest version of the DLL and this didn't seem to resolve the issue.

The PHP page is very basic and just reads $_SERVER['HTTP_USER_AGENT'] and outputs it to a file. Using a browser works fine.

Are there any suggestions to get this to work?

asked Aug 30 at 03:58

JHilton's gravatar image

JHilton
11


Headers such as User-Agent, are only automatically added for HTTP methods that don't have an HttpRequest object argument. For methods such as SynchronousRequest where an HttpRequest object is passed in, the headers are completely specified by the HttpRequest object.

To summarize:

For methods such as QuickGetStr, QuickPutStr, PostJson, etc, where there is no HttpRequest argument, then some default headers are added, and request headers can be added/modified/removed by calling SetRequestHeader and RemoveRequestHeader.

For methods where an HttpRequest argument exists, the headers are specified by the HttpRequest object, and nothing is implicit (except for Content-Length).

link

answered Aug 31 at 08:57

chilkat's gravatar image

chilkat ♦♦
12.8k317366475

I recommend trying the latest version of the library to see if it is a bug that has already been fixed.

link

answered Aug 30 at 18:07

jpbro's gravatar image

jpbro ♦
1.1k2618

Hi,

As per the original question, I have already tried upgrading to the latest DLL without any luck.

(Aug 31 at 02:55) JHilton

Your original post indicates you are using 9.5.0.54, but the latest is 9.5.0.69.

(Aug 31 at 08:47) jpbro ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×13

Asked: Aug 30 at 03:58

Seen: 1,242 times

Last updated: Aug 31 at 08:57

powered by OSQA