Jump to content

Custom Headers via HTTP in?


Haravikk Mistral
 Share

You are about to reply to a thread that has been inactive for 2730 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Does HTTP in support the sending of custom HTTP headers?

I've been trying to send any kind of data at all via HTTP headers to a script in-world and it doesn't seem to receive any of them, however the only restriction mentioned on headers is that requests to llGetHTTPHeader() need to be in lowercase, there is no mention of headers being removed.

Is anyone aware of any other restrictions on which headers can and cannot be sent to an LSL script, and whether any of them can be used to pass custom details?

I had thought that passing some simple data via a custom header would avoid the need to perform additional processing on the message body in http_request(), however I cannot get it to work at all.

Link to comment
Share on other sites

i tried playing with it and couldn't get it to work either, ..

 

 you can use other parts of the header to send info tho?

so if you had something like ... URL += "/male/furry/?name=Haravikk";

and the GET request...

http_request_id = llHTTPRequest(URL ,
[ HTTP_METHOD, "GET",
HTTP_MIMETYPE, "text/plain",
HTTP_BODY_MAXLENGTH,16384,
HTTP_PRAGMA_NO_CACHE,TRUE], "");

you would get a string for each, so in your recieving obj...

http_request(key id, string method, string body)
{

if(method=="GET")
{ string text1 = llGetHTTPHeader(id, "x-path-info");
  string text2 = llGetHTTPHeader(id, "x-query-string");
  llOwnerSay("\nPath: " + text1 + "\nQuery..." + text2);
}
}

 

text1 .../male/furry/   

text2 ...name=Haravikk

and parse from there?

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2730 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...