Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

WebGl build with WWW POST data is blank on the server

$
0
0
My unity game uses a WWW to POST data to a PHP server. When I run the game from the editor, all is fine. However, when I run the WebGL build, my server is getting blank data. Why? I'm using Unity 5.1.2f1. 1) Dictionary header = new Dictionary(); header.Add("Access-Control-Allow-Credentials", "true"); header.Add("Access-Control-Allow-Headers", "Accept"); header.Add("Access-Control-Allow-Methods", "POST"); header.Add("Access-Control-Allow-Origin", "*"); WWW www = new WWW(_serverURL, data, header); 2) WWWForm form = new WWWForm(); form.headers.Add("Access-Control-Allow-Credentials", "true"); form.headers.Add("Access-Control-Allow-Headers", "X-Requested-With"); form.headers.Add("Access-Control-Allow-Headers", "Content-Type"); form.headers.Add("Access-Control-Allow-Methods", "POST"); form.headers.Add("Access-Control-Allow-Origin", "*"); form.AddBinaryData("data", data);` WWW www = new WWW(_serverURL, form); Any ideas?

Viewing all articles
Browse latest Browse all 2390

Trending Articles