Hi Dave,
As other members have mentioned, the error you encounter is likely due to
the data you appened in request's url(querystring) has exceeded the max
length of the http querystring limit. Normally, for very large data, HTTP
POST protocol is surely the recommended means to post them.
As for how to do http post with .NET component, you can use either
WebClient or HttpWebRequest class. For webrequest class, you need to open
the "RequestStream" of it and then write the message body(you want to
transfer) into the requeststream and then send it. AdemusPrime has posted
some detailed code sample in his message, you can have a look.
Here are some other web article provided sample code of doing http post
with .NET webrequest component:
http://authors.aspalliance.com/steve...netscrape2.asp http://weblogs.asp.net/ngur/archive/...11/129951.aspx http://www.netomatix.com/httppostdata.aspx
Hope this also helps some.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Dave" <DW**@newsgroup.nospam>
Subject: HttpPost
Date: Fri, 16 May 2008 10:51:45 -0400
I'm writing an app that needs to send info to a client by their specs,
m_request= "https://website.com/app?xml=xml_file&xmlString=<?xml
version='1.0' encoding='utf-8' ?>xmlfilecontentset...etc</endfile>"
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(m_request);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Which works fine for a small file, 3k or less, but for a file with more
items in the xml file the server return a "500 Internal Server Error"
Is the HTTPWebResponse call basically a send statement instead of an
HttpPost? How would I do an HttpPost?
Thanks