Questions tagged [unitywebrequest]
97 questions
1
vote
2 answers
how to post my data using UnityWebRequest post api call
Here is my API request
public IEnumerator Login(string bodyJsonString)
{
Debug.Log(bodyJsonString);
UnityWebRequest req = UnityWebRequest.Post("localhost:3000/login", bodyJsonString);
req.SetRequestHeader("content-type",…

Frank Mendez
- 546
- 3
- 13
- 26
1
vote
1 answer
On iOS, UnityWebRequest download stops when app goes to background
I use UnityWebRequestAssetBundle.GetAssetBundle to download asset bundles located on a remote server. While everything works as expected on Android, the download stops on iOS when minimizing the app (or when the device goes to sleep).
When I…

Florian
- 21
- 2
1
vote
1 answer
How to write HTTP post sending an image file (.jpg/.png) in Unity by using UnityWebRequest?
I want to do a post request in Unity using UnityWebRequest. I have to send a jpg image or png image and the api has to response with a string message or int code.
How to write the C# Script to send the data through post?

pablomargolin
- 49
- 4
1
vote
1 answer
POST requests to Flask from Unity result in `null` values
After getting this demo server working I am able return GET requests from it to Unity, but when I would try to send data from Unity to the local server using POST requests it would only show null values added into the server. This is the code I was…

sundialer
- 33
- 8
1
vote
1 answer
How to check the unity web service instantly?
In a project that I will develop with Unity, I need to check the data coming from the web service instantly. If a new data entry has been made, I will display it as a notification.
The problem is: How can Unity check the data from the web service in…

kozyalcin
- 83
- 10
1
vote
1 answer
ASP.NET 4.5 Rest API's work in Unity Android/iOS build but fails with "Unknown error" in Unity WebGL build
I have scoured every possible forum for this and somehow have not gotten my WebGL to consume my ASP.NET 4.5 REST API's.
From what I can tell it is possibly related to WebGL requiring CORS, but even enabling this I cannot get the game to communicate…

Tiaan
- 698
- 2
- 10
- 32
1
vote
1 answer
UnityWebRequest not working after updating Android OS
The following used to work on both the PC Unity Editor and my mobile device:
WWWForm Fields = new WWWForm();
Fields.AddField("dummy","");
UnityWebRequest www = UnityWebRequest.Post(Apis.internetTest, Fields);
yield…

Chong Lip Phang
- 8,755
- 5
- 65
- 100
1
vote
1 answer
How to Upload multiple files to a server using UnityWebRequest.Post();
I am trying to upload multiple files using UnityWebRequest.Post(), here's my code.
public void UploadFiles()
{
string[] path = new string[3];
path[0] = "D:/File1.txt";
path[1] = "D:/File2.txt";
path[2] = "D:/File3.txt";
…

Junaid Pathan
- 3,850
- 1
- 25
- 47
1
vote
0 answers
Is it necessary to update to https when using http in UnityWebRequest for iOS app
I’m trying to test my app in iPhone, but Xcode throws this error:
You are using download over http. Currently Unity adds NSAllowsArbitraryLoads to Info.plist to simplify transition, but it will be removed soon. Please consider updating to…

D. Guzman
- 11
- 1
0
votes
0 answers
Unity: Why downloading a text asset from internet doesn't work?
I tried to use a coroutine to download a get a text by UnityWebRequest.Get(url);
In the NetworkManager Class, I have these two exactly identical Coroutines but in different name:
public static IEnumerator DownloadTextCoroutine(string url,…
0
votes
0 answers
Upload a Mesh to Scene that Created with Unity WebGL
I want to develop a webapp with Unity WebGL. I want to create a html button for uploading meshes. The uploaded mesh is going to display on the Unity's scene. How can i do this?
I tried to develop with gpt but its code has many errors.
0
votes
0 answers
UnityWebRequest - Set sessionId as a Cookie: Refused to set unsafe header Cookie
I'm facing a problem with setting the sessionId cookie in the UnityWebRequest.
public static class CheckSession_LiveHandler
{
public static IEnumerator Send(APIRequest _request, APIResponse…
0
votes
0 answers
Async Method Causing Unity to Memory Leak
Context:
I'm using Unity to reach an endpoint, this endpoints belongs to me and is returning the correct type of information.
I'm starting my calls from here(with correct request):
public async Task…

Joao Silva
- 23
- 4
0
votes
1 answer
How to fix my encoding Issues between Unity and Java Spring Server?
I am sending a UnityWebRequest to my Java Spring Server from my application in Unity. If I send the word "house", then "houseÔÇï" arrives there. However, the error does not happen when I send the request from Postman, for example.
The creation of…

Mergo
- 64
- 6
0
votes
0 answers
Converting HttpRequest to UnityWebRequest
I want to build my project to WebGL and I need to use UnityWebRequest instead of HTTPWebRequest because System.Net namespaces is not supported on WebGL.
I am having issues converting the working HTTPRequest to a UnityWebRequest.
/// Opens A…

Elefank
- 41
- 4