Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ContextMenu("Request")]
- public void Request()
- {
- WWWForm form = new WWWForm();
- Dictionary<string, string> headers = form.headers;
- headers["Welcome"] = API_KEY;
- form.AddField("userName","MaciejH");
- byte[] rawFormData = form.data;
- WWW request = new WWW(URL,rawFormData, headers);
- StartCoroutine(OnResponse(request));
- }
- IEnumerator OnResponse(WWW req)
- {
- yield return req;
- Debug.Log(req.text);
- }
Advertisement