Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void TryLogin ()
- {
- UnityWebRequest req = UnityWebRequest.Get ("Your jenkins login url of network");
- req.method = "GET";
- req.SetRequestHeader("Authorization", "Basic " + Convert.ToBase64String (Encoding.UTF8.GetBytes ("jenkinsId:jenkinsPassword")));
- StartCoroutine (WaitForLoginRequest (req));
- }
- IEnumerator WaitForLoginRequest(UnityWebRequest req)
- {
- yield return req.Send ();
- if (req.isError)
- {
- Debug.Log ("WWW Error: " + req.error);
- }
- else
- {
- Debug.Log("WWW Ok!:");
- string response = Encoding.UTF8.GetString (req.downloadHandler.data);
- Debug.Log ("Response code = " + req.responseCode);
- Debug.Log ("String = " + response);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement