हैलो मैं सी # (पोस्ट) में एक HTTP अनुरोध लिखने की कोशिश, लेकिन मैं एक त्रुटिकैसे एक HTTP अनुरोध लिखने के लिए
Expl साथ मदद की जरूरत: मैं सर्वर से एक डीएलसी फ़ाइल की सामग्री भेजना चाहते हैं और डिक्रिप्टेड सामग्री को दोबारा दोहराएं।
सी # कोड
public static void decryptContainer(string dlc_content)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://dcrypt.it/decrypt/paste");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.Accept = "Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
using (StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII))
{
writer.Write("content=" + dlc_content);
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
Console.WriteLine(reader.ReadToEnd());
}
}
और यहाँ मैं एचटीएमएल अनुरोध
मिला<form action="/decrypt/paste" method="post">
<fieldset>
<p class="formrow">
<label for="content">DLC content</label>
<input id="content" name="content" type="text" value="" />
</p>
<p class="buttonrow"><button type="submit">Submit »</button></p>
</fieldset>
</form>
त्रुटि संदेश:
{
"form_errors": {
"__all__": [
"Sorry, an error occurred while processing the container."
]
}
}
बहुत उपयोगी है, तो किसी ने मुझे समस्या को हल करने में मदद कर सकता होगा!
http://codesamplez.com/programming/http-request-c-sharp – happy