- Home /
Use of HttpClient in WebGL export
Hi, I'm currently working on a Unity project as part of a student internship program. My current work requires me to export a Unity project that utilises a TTS API in WebGL. For that reason, I have taken reference from this Github project (https://github.com/ActiveNick/Unity-Text-to-Speech).
However, I have some identical issues exporting both mine and this Github project in WebGL format (even though standalone works fine), with the console saying that a certain namespace could not be found. The namespace in question is Cognitive Services, which is found in the script TTSClient.cs. I suspect this has to do with the use of HttpClient in TTSClient.cs, which from what I understand, had problems with Unity in the early 2018 versions. However, the Github project is running on 2018.4, while my own is on 2019.3, yet the same error persists.
My question is therefore, is it possible to use HttpClient in a project meant to be exported in WebGL? If so, is there a possible workaround?
I apologise if this is a simple question, as I am still trying to learn Unity, and working with APIs and WebGL is a new field for me.
HttpClient must be using multitrading which is not supported on WebGL.
Thanks for the reply misher. In that case, would it be better to substitute HttpClient with UnityWebRequest?
Your answer
Follow this Question
Related Questions
WebGL deployment question 0 Answers
i cant use wepGL in unity 0 Answers
Exporting user created gameobject to folder on server as obj WebGL? 0 Answers
Import/Export of save file string 0 Answers
Scenes turning blue when changing platform to WebGL 1 Answer