Hey,
So I am trying to link https://avwx.rest/ to my project. I have implemented the API fine and it works as expected, the only issue I have is that I have no idea where to place the authentication script. Here is my code:
public class METARScript : MonoBehaviour
{
private readonly string AVWXURL = "https://private-anon-f687e87c21-avwx.apiary-mock.com/api/metar/egss";
private void Start()
{
StartCoroutine(loadMETAR());
}
IEnumerator loadMETAR()
{
UnityWebRequest METARInfoRequest = UnityWebRequest.Get(AVWXURL);
yield return METARInfoRequest.SendWebRequest();
if(METARInfoRequest.isNetworkError || METARInfoRequest.isHttpError)
{
Debug.Log(METARInfoRequest.error);
yield break;
}
JSONNode METARInfo = JSON.Parse(METARInfoRequest.downloadHandler.text);
string METAR = METARInfo["sanitized"];
print("The METAR for EGSS is: " + METAR);
}
}
I am trying to add the authentication key: --stripped-- which will give permission to access the data on the server.
Can anyone shed any light on how to do this?
Thanks