This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
zekesonxx's profile picture

HTTP User-Agent

Started by zekesonxx, 10 January 2013 - 10:56 AM
zekesonxx #1
Posted 10 January 2013 - 11:56 AM
Short suggestion here. Why not make the User-Agent string with the HTTP API something like "ComputerCraft v1.4, Java 1.6"?

It would be nice to distinguish between ComputerCraft and other unlabeled Java things.
lieudusty #2
Posted 10 January 2013 - 12:21 PM
This would be nice, so maybe a custom site for CC only? Idk just random ideas xD
Left4Cake #3
Posted 10 January 2013 - 04:04 PM
Really this may only come in handy if a computercraft or minecraft related site wanted to be computercraft compatible.
dissy #4
Posted 10 January 2013 - 05:09 PM
It would be handy to access websites that actively block "web bots", which such sites assume the "Java" useragent must be.
You can't even do a Google search currently because of the user agent.

Also while adding in the ability to set headers, aka user-agent, that would also provide the ability to set another header, "cookie". Accepting and replying with cookies would be exceptionally helpful, pretty much for any site that requires sign-in.

I made the same request a few months back, and seemed to have a lot of support in the community for the feature.
The good news is it wasn't rejected by those in charge - always a good sign :}
The sorta-bad news is that there hasn't been any other pressing reason to redesign the http code, which unfortunately is a lot to ask for without additional reasons to make the whole thing worth while.
Xfel #5
Posted 12 January 2013 - 07:10 PM
Why not just allow the User to specify a custom Header table?
theoriginalbit #6
Posted 12 January 2013 - 07:19 PM
Why not just allow the User to specify a custom Header table?
This would be EXTREMELY handy! I could continue development on my projects "Google for CC" and "Git Utils"…
Xfel #7
Posted 13 January 2013 - 02:06 AM
Well, using an additional table for Header fields would be easy enough, but unfortunately you can't pass a table as argument to an API function…
Eric #8
Posted 13 January 2013 - 03:59 AM
Well, using an additional table for Header fields would be easy enough, but unfortunately you can't pass a table as argument to an API function…
What? Why not? Is that a restriction of LuaJ, or just the way ComputerCraft expects you to expose APIs?
Cloudy #9
Posted 13 January 2013 - 04:13 AM
It's our restriction. May change, may not.