我正在尝试使用谷歌云打印。云打印的/search api用于获取printerid和xsrf令牌..所以我发布数据并试图获得响应但每次我发布我得到远程服务器返回一个错误:(403)禁止..是吗跨域问题还是什么问题?
string str= TextBox1.Text;
var request = (HttpWebRequest)WebRequest.Create("https://www.google.com/cloudprint/search?output=json&clientid=" + str);
request.Method = "POST";
SetupWebRequest (request);
string postData = "This is a test that posts this string to a Web server.";
byte[] byteArray = Encoding.UTF8.GetBytes (postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
// Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length);
// Close the Stream object.
dataStream.Close();
WebResponse response = request.GetResponse ();