We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string query = System.Web.HttpUtility.UrlEncode("https://developers.naver.com/notice", Encoding.UTF8) // 수정 내용
using System; using System.Net; using System.Text; using System.IO; namespace NaverAPI_Guide { public class APIExamURL { static void Main(string[] args) { string url = "https://openapi.naver.com/v1/util/shorturl"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Headers.Add("X-Naver-Client-Id", "YOUR_CLIENT_ID"); // 개발자센터에서 발급받은 Client ID request.Headers.Add("X-Naver-Client-Secret", "YOUR_CLIENT_SECRET"); // 개발자센터에서 발급받은 Client Secret request.Method = "POST"; //string query = "https://developers.naver.com/notice"; // 단축할 URL 대상 string query = System.Web.HttpUtility.UrlEncode("https://developers.naver.com/notice", Encoding.UTF8) // 수정 내용 byte[] byteDataParams = Encoding.UTF8.GetBytes("url=" + query); request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = byteDataParams.Length; Stream st = request.GetRequestStream(); st.Write(byteDataParams, 0, byteDataParams.Length); st.Close(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream stream = response.GetResponseStream(); StreamReader reader = new StreamReader(stream, Encoding.UTF8); string text = reader.ReadToEnd(); stream.Close(); response.Close(); reader.Close(); Console.WriteLine(text); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
기존 샘플 코드 에로 발생. code 수정 요청.
string query = System.Web.HttpUtility.UrlEncode("https://developers.naver.com/notice", Encoding.UTF8) // 수정 내용
The text was updated successfully, but these errors were encountered: