当我使用Linden Scripting Language从LlHTTPRequest脚本向PHP发送请求时,我没有在PHP中获取值:
示例:(LSL)
if(group_invite == "yes")
{
list agents = llParseString2List(this_agent_name, [" "], []);
string params = llDumpList2String([
"firstname=" + llList2String(agents, 0),
"lastname=" + llList2String(agents, 1)],
"&");
llHTTPRequest(
"http://mysite/post-page.php",
[HTTP_METHOD,"POST"],
params);
}
我从未获得firstname
和lastname
值。
答案 0 :(得分:1)
要在POST请求中以该格式提交参数,您的请求必须将Content-Type
标头设置为application/x-www-form-urlencoded
:
llHttpRequest(
"http://example.com/post-page.php",
[HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"],
params);