Questions tagged [unitywebrequest]

97 questions
0
votes
1 answer

Why is OpenAI image generation Api returning 400 bad request in Unity?

I'm testing out dynamically generating images using OpenAI API in Unity. Amusingly, I actually generated most of this code from chatGPT. The Error response is: "Your request contained invalid JSON: Expecting value: line 1 column 1 (char 0)". But I…
0
votes
0 answers

CORS error with UnityWebRequest from ASP.NET Web API 6.0 with CORS enabled

I'm working on a WebGL game with Unity in which I am attempting to call a custom built ASP.NET Web API that's built specifically to work with the game. I've added the code I thought was necessary to get CORS working for making the API requests from…
Ahimaaz
  • 43
  • 4
0
votes
0 answers

Unity HTTP/1.1 400 Bad Request while fetching data from Mongo Atlas

I'm trying to fetch a collection with Mongo Atlas Data API. In API logs, Status seems as "OK" but i'm getting "Bad Request" error in Unity editor. Am I missing something? Thanks for helps. using UnityEngine; using UnityEngine.Networking; using…
0
votes
1 answer

How to send UnityWebRequest POSTmethod with JSON param to a server using Unity

I'm trying to send a unitywebrequest var webRequest = UnityWebRequest.Post("https://example.com/api/auth/login","{\"username\": \"demo2\",\"password\": \"demo2\",\"password2\": \"demo2\"}"); webRequest.SetRequestHeader("accept",…
0
votes
0 answers

convert HttpWebRequest authentication with cookies into UnityWebRequest

I'm authenticating with a server that, through a series of redirects sets a CSRF cookie. I also get a oauth2 cookie that I need to include for all subsequent queries. I'm able to obtain all the cookies and authenticate using HttpWebRequest - but I'd…
YMDW
  • 411
  • 1
  • 5
  • 16
0
votes
1 answer

UnityWebRequest Get api call returns connection error

So I am trying to do the Get method call to retrieve data from api server.The problem I am getting is that in Unity Editor, Both Get and Post method works perfectly fine, but in the webgl build only post method works whereas Get method returns 500…
0
votes
0 answers

Get fetched web page data as a byte array using UnityWebRequest

So the problem I have is that I don't know how can I get the fetched web page data as a byte array using UnityWebRequest since my WWW is obsolete right now. For now it looks like that
Adeoon
  • 41
  • 3
0
votes
2 answers

API GET request through unity

I have followed two different tutorial on how to get API requests with headers through Unity. One uses WWWForm and the other uses UnityWebRequest. I want to send my API-key through headers, it works with WWWForm, but I want to use UnityWebRequest…
Naveed
  • 17
  • 1
  • 3
0
votes
0 answers

unity WebRequest - Windows security

Hi guys I have problem with Windows Antivirus I downloaded a zip file from the IPFS My code : using (UnityWebRequest wwwAssetsDownloader = UnityWebRequest.Get(JsonData[3])) { yield return…
0
votes
0 answers

Password fields being displayed as plain text in heroku logs for graphql requests (UnityWebRequest)

I have an application with the following tech stack web frontend app in React backend with Python/Django GraphQL API using graphene + django-graphql-auth for authentication MySQL DB hosted on Heroku In addition to this, the backend is also used by…
0
votes
0 answers

UnityWebRequestTexture.GetTexture() web request does not get a response from server, CORS issue maybe?

I have a Unity project where I'm trying to scrape images from websites but some of the URL's that I try to download images from don't work. So for example, if I try to use UnityWebRequestTexture.GetTexture() with this URL…
Ace
  • 11
  • 3
0
votes
0 answers

UnityWebRequest - Loading Many Audio Files For Rhythm Game Is Slow

Function to load audio in LoadFile.cs: public async Task LoadAudioFile(string path) // Loads *.mp3's { //Load audio from the chosen *.mp3 file using UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(path,…
Ramin Amiri
  • 151
  • 1
  • 3
  • 12
0
votes
1 answer

PHP not getting POST data from Unity

I am trying to send POST data from Unity to PHP server. C#: WWWForm form = new WWWForm(); form.AddField("playerName", "myName"); using (UnityWebRequest www = UnityWebRequest.Post("https://myserver.com/savedata.php", form)) { …
0
votes
1 answer

Unity throw "unknown error" while connecting to https website

Today suddenly UnityWebRequest started to throw out "unknown error" with the website which was fine during at least 1 year. Here is the code: WWWForm form = new WWWForm(); UnityWebRequest www = UnityWebRequest.Post("https://somedomain.com",…
0
votes
1 answer

How to use WriteAllBytes if using UnityWebRequest?

I use UnityWebRequest in getting the file on streamingassets folder because WWW is obsolete, now on FileWriteAllBytes i cant right downloader.bytes because it is return an error to me can someone help me #if UNITY_ANDROID // path on…