LlHTTPResponse/ja

From Second Life Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

要約

関数: llHTTPResponse( key request_id, integer status, string body );

request_idstatusbody を返却します。

• key request_id 有効な HTTP リクエストのキー。
• integer status HTTPステータスコード( 200, 400, 404, など)
• string body レスポンスの内容。

http_request イベントの中でレスポンスを生成する必要はありませんが、タイムリーに発生しないと、リクエストがタイムアウトすることになります (20秒以内) 。

警告

  • この関数の呼び出しは、http_request イベントを含んでいる request_id を受け取ったスクリプトによって行わなければなりません。
  • http_request/jabody は 2048 バイト制限 されます。このため、SL のオブジェクトにレスポンスを返す場合、2K を超える文字列は受信先で消えてなくなります。
All Issues ~ Search JIRA for related Bugs

サンプル

key url_request;

default
{
    state_entry()
    {
        url_request = llRequestURL();
    }
    http_request(key id, string method, string body)
    {
        if (url_request == id)
        {
            url_request = "";
            if (method == URL_REQUEST_GRANTED)
            {
                llSay(0,"URL: " + body);
            }
            else if (method == URL_REQUEST_DENIED)
            {
                llSay(0, "Something went wrong, no url. " + body);
            }
        }
        else
        {
            llHTTPResponse(id, 200, body);
        }
    }
}

関連項目

イベント

•  http_request

関数

•  llGetFreeURLs
•  llRequestURL
•  llRequestSecureURL
•  llReleaseURL
•  llGetHTTPHeader

記事

•  LSL http server

特記事項

経緯

Search JIRA for related Issues

Signature

function void llHTTPResponse( key request_id, integer status, string body );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。