Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- var form = "rc_username=userMailHere&rc_password=userPasswordAsPlainTextHere";
- var bytesToSend = Encoding.UTF8.GetBytes(form);
- WebRequest request = WebRequest.Create("http://theAuthenticationEndpoint.net");
- request.Method = WebRequestMethods.Http.Post;
- //request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = bytesToSend.Length;
- using (var stream = request.GetRequestStream())
- {
- stream.Write(bytesToSend, 0, bytesToSend.Length);
- }
- var response = request.GetResponse();
- //var status = ((HttpWebResponse)response).StatusCode;
- var responseText = (new StreamReader(response.GetResponseStream()).ReadToEnd());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement