Page 1 of 1

Socket User-Agent?

Posted: June 2nd, 2006, 8:09 am
by bradshaw1965
I've been playing with the Socket object and the User-Agent seems to be "-" which just may be my version of Apache's version of Null. Has anybody worked with changing this info to be a better citizen in web service consumption?

The object doesn't seem to be open to much introspection.

Best,

Dale

Posted: June 3rd, 2006, 2:56 pm
by bradshaw1965
hey folks,

Following up with an answer to my own question. Since we can craft the GET or POST request line by line. The User-Agent is simply a line in the request, like so.

Code: Select all

webConnect.write('GET /socketDemo/sampleProject.json HTTP/1.0  \nUser-Agent: OurFantasticWebService\n\n');
Best,

Dale