Created
September 9, 2011 18:08
-
-
Save mimeoconnect/1206910 to your computer and use it in GitHub Desktop.
Doc APIs - Poster - Proof (POST)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
using System.Web.UI.HtmlControls; | |
using System.Data; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using System.Xml; | |
namespace Mimeo | |
{ | |
public class Poster | |
{ | |
public void Proof() | |
{ | |
string userid = "[user id]"; | |
string userkey = "[user key]"; | |
string pdfurl = "[url of PDF]" | |
string format = "json"; | |
string environment = "Sandbox"; | |
System.Text.StringBuilder build_url = new System.Text.StringBuilder(); | |
build_url("https://developer.mimeo.com/api/poster/post/"); | |
string post_url = build_url(); | |
System.Text.StringBuilder build_post = new System.Text.StringBuilder(); | |
build_post("?userid="+userid); | |
build_post("&userkey="+userkey); | |
build_post("&orderId="+orderId); | |
build_post("&format="+format); | |
build_post("&environment="+environment); | |
string post_fields = build_post(); | |
HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create (post_url); | |
request.Method = "POST"; | |
StreamWriter postwriter = new StreamWriter(myHttpWebRequest dsds.GetRequestStream()); | |
postwriter.Write(post_fields); | |
postwriter.Close(); | |
string new_product_template = ""; | |
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) | |
{ | |
// Get the response stream | |
StreamReader reader = new StreamReader(response.GetResponseStream()); | |
// Console application output | |
response = reader.ReadToEnd(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment