# POST JSON method does not work when project has been exported to WEBGL and uploaded to firebase hosting

I have a database set up on firebase and when i run my game in the unity edtitor and as a standalone exported Windows .exe file, the call gets made correctly to the database and JSON data gets posted correctly. However when I export the exact same project to WEBGL and upload it to my firebase hosting server, the JSON call does not work. Here is my code, could someone please help?

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

{
public InputField nameInputField;

{
}

public void SubmitScore()
{
StartCoroutine(SendScore());
}
// Use this for initialization
void Start()
{

}

// Update is called once per frame
void Update()
{

}

public IEnumerator SendScore()
{
Scoreboard s = new Scoreboard(nameInputField.text, PlayerPrefs.GetInt("Score"), PlayerPrefs.GetInt("Seed"));
Dictionary<string, string> headers = new Dictionary<string, string>();
Hashtable data = new Hashtable();

UnityHTTP.Request postRequest = new UnityHTTP.Request("post", "https://alexclearythesisgame.firebaseio.com/Scoreboard.json", data);
postRequest.Send();
yield return postRequest.isDone;
}

}

• Check answers.unity.com/questions/898360/… I believe you must configure first some cross domain access, never done that myself. – arielsan Jul 29 '18 at 16:51
• Thank you for your comment . I actually found a solution and will be posting it below . It had something to do with dll files and unity webgl so I had to use the following rest api : github.com/proyecto26/RestClient/blob/master/README.md . Thanks for the comment as it reminded me to update the question – AC007 Jul 30 '18 at 17:05