Is that possible to add header information in the GET method of the built in www request.
I've done the following code in Corona and what's the similar version to Unity. WWWform can add headers and it can be used only for POST method.
gamer info
local params = {};
params.headers = headers;
params.body = "email=" .. tempRivalID .. "&password=" .. tempPwd;
The key is leaving “postData” parameter to null. From Unity3D WWW reference
The WWW class will use GET by default
and POST if you supply a postData
parameter.
So this one works for me:
var form = new WWWForm();
var headers = new Hashtable();
headers.Add("Header_key", "Header_val");
www = new WWW("http://localhost/getpostheaders", null, headers);
yield return www;
Debug.Log("2. " + www.text);