Skip to content

Instantly share code, notes, and snippets.

@jamesaxl
Created January 3, 2015 14:08
Show Gist options
  • Save jamesaxl/16e817c58bb7e523ff35 to your computer and use it in GitHub Desktop.
Save jamesaxl/16e817c58bb7e523ff35 to your computer and use it in GitHub Desktop.
var values = new System.Collections.Specialized.NameValueCollection();
values["code"] = content;
values["lexer"] = language;
values["expiry"] = expiry;
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
Session.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
var message = Session.UploadValues("https://bpaste.net/", "POST", values);
var url = System.Text.Encoding.Default.GetString(message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment