Need help converting code from Java to Unity's C#
The original code using Apache's HttpClient, HttpPost, HttpResponse, and HttpEntity. I'm trying to use them to access Reddit's json API, but I don't know for sure if WWW, wwwForm. or System.Net's HttpWebRequest and HttpWebResponse stuff is used for the same thing. This is my first time trying to use an API or use these classes, so go easy on me!
If you need to know, here is a snippet of code from the java class:
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("https://www.reddit.com/api/v1/access_token");
httppost.setHeader("User-Agent", "my header");
httppost.setHeader("Authorization", basicAuth);
Answer by LovelyVibes · Mar 05, 2017 at 06:04 AM
@TehTechnomancer This website with convert Javascript (UnityScript) to C# for you. ^~^
Your answer
Follow this Question
Related Questions
Unity www class connect to https ip; Unknown Error. 0 Answers
UnityWebRequest, C# request.accept equivalent? 1 Answer
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure 3 Answers
WWW class doesn't work well. 1 Answer
How can resolve URL with caracter like & and other ? 2 Answers