Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

WWW.responseHeaders

マニュアルに切り替える
public Dictionary<string,string> responseHeaders;

説明

リクエストで返されるヘッダーの Dictionary

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class test : MonoBehaviour { public string url = "http://unity3d.com"; IEnumerator Start() { WWW www = new WWW(url); yield return www;

if(www.responseHeaders.Count > 0) { foreach(KeyValuePair<string, string> entry in www.responseHeaders) { Debug.Log(entry.Value + "=" + entry.Key); } } } }

これらのコード例を使用しているとき、エディター設定で http://unity3d.com に WWW Security Emulation. Host URL を設定したい場合は注意してください。これを忘れると、例外規定を与えられるかもしれません。