Jump to content
SubZeroWins

HTTP request with custom headers

Recommended Posts

Hello, I read in the wiki that you can set custom headers for the http request. Its many days that I try to send a custom user agent but it never works as the script throws an error.

The script

llHTTPRequest("http://urlhere.com", [HTTP_USER_AGENT, "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", HTTP_METHOD, "POST",HTTP_MIMETYPE, "application/x-www-form-urlencoded"], "Check=1")

 

And the error I get 

HTTP_USER_AGENT 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36' is invalid

 

I really wonder if its possible at all.

Share this post


Link to post
Share on other sites

Well, this is also from the wiki:
Note: Spaces are not allowed in HTTP User Agent token values, so "My Script Name/1.0" will produce a script error; change the spaces to hyphens ("-")  

Share this post


Link to post
Share on other sites

Same error again

HTTP_USER_AGENT 'Mozilla/5.0-(Windows-NT-6.1;-Win64;-x64)-AppleWebKit/537.36-(KHTML,-like-Gecko)-Chrome/67.0.3396.99-Safari/537.36' is invalid

Share this post


Link to post
Share on other sites
 llHTTPRequest("http://urlhere.com", [HTTP_CUSTOM_HEADER, "HTTP_USER_AGENT", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", HTTP_METHOD, "POST",HTTP_MIMETYPE, "application/x-www-form-urlencoded"], "Check=1");

does not give a error.

Share this post


Link to post
Share on other sites

If the header value should not contain spaces but hyphens, then it should give an error, as the wiki suggests. As this does throw error.

However if the replaced all spaces and still its wrong.

Share this post


Link to post
Share on other sites

Because the web server Im trying to fetch data from, appears to have blocked any requests made from in world.

They didnt use to but now they do.

Share this post


Link to post
Share on other sites
1 hour ago, SubZeroWins said:

Because the web server Im trying to fetch data from, appears to have blocked any requests made from in world.

Maybe they don't want you doing that?

If they really are blocking requests from LSL, they most likely are matching on the presence of the LSL version, which is included automatically and you cannot remove; see the wiki page

Quote

The user agent value is appended to the one generated by LSL 

Have you tried asking them?

Share this post


Link to post
Share on other sites

Its a free server and they dont use to respond back soon, if not at all.

So it seems that there is no way to send custom agents, right?

Share this post


Link to post
Share on other sites
4 hours ago, SubZeroWins said:

So it seems that there is no way to send custom agents, right?

Not completely, no. We want to unambiguously identify what is being done with LSL so that it's more difficult for bad actors to use it inappropriately. 

Share this post


Link to post
Share on other sites
1 hour ago, SubZeroWins said:

Not completely? Then what is the secret? lol

The HTTP Request header must meet certain format requirements. There are forum threads on it, raised by @Oz Linden.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...