httpwebrequest

c# is WebRequest.Create gives me a URL encoded?

流过昼夜 提交于 2020-01-05 13:07:17
问题 I have been giving an API to send SMS, the API states that I should use this url http://<server>:<port>/bulksms/bulksms? username=XXXX&password=YYYYY&type=Y&dlr=Z&destination=QQQQQQQQQ&sour ce=RRRR&message=SSSSSSSS<&url=KKKK> Where message and url must be URL-UTF-8 encoded . what I did is creating that url like this: string urlSMS = string.Format("http://{0}:{1}/bulksms/bulksms?username={2}&password={3}&type={4}&dlr={5}&destination={6}&source={7}&message={8}&url=0", server, port, username,

HTTP Request performance for large volumes of requests

試著忘記壹切 提交于 2020-01-05 10:33:28
问题 I'm looking for some advice on how to optimise the following process: App reads csv file. For each line in the file an XML message is created Each XML message is posted to a URL via a HTTPWebRequest This process was designed to handle low volumes of messages (up to about 200 at a time), un suprisingly thinks have changed and it is now expected to handle up to about 3000 at a time. The code used to post the message is here: Public Function PostXml(ByVal XML As String) As HttpStatusCode Try Dim

HttpWebRequest Operation Timeout with CookieContainer

心已入冬 提交于 2020-01-05 08:09:45
问题 When I am using HttpWebRequest and add this: CookieContainer container = new CookieContainer(); request.CookieContainer = container; it will throw an Operation Timeout exception in HttpWebResponse response = request.GetResponse() as HttpWebResponse; If I don't add the CookieContainer the program runs without errors. Why doesn't this work? 回答1: How are you creating Request object?? HttpWebRequest request = (HttpWebRequest)WebRequest.Create(args[0]); request.CookieContainer = new

The '', Hexadecimal value 0x1F, is not a valid character. Line 1, Item 1

血红的双手。 提交于 2020-01-05 04:43:28
问题 I am getting xml data through an httpwebrequest. The following code was working fine. But something changed and suddenly started to give me an exception on Read() method with error : The '', Hexadecimal value 0x1F, is not a valid character. Line 1, Item 1. In web browser sURL gives me a valid xml. I dont know what changed. HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL); req.Method = "GET"; WebResponse response = req.GetResponse(); StreamReader resStreamReader = new StreamReader

Error: Could not create SSL/TLS secure channel Windows 8

六眼飞鱼酱① 提交于 2020-01-05 04:15:34
问题 After upgrading to Windows 8, I am having problems with a web service call that was previously working. I've already verified on two Windows 8.1 machines and one Windows 8 machine that the following code fails, but it works without error on Windows 7 and Windows Server 2008 R2. var uriString = "https://secure.unitedmileageplus.com/"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uriString); try { using(WebResponse response = request.GetResponse()) { response.Dump(); } } catch

Is it possible to append request parameters to a HTTP DELETE request in ajax?

*爱你&永不变心* 提交于 2020-01-05 03:56:16
问题 I'm trying to submit a simple jQuery ajax call but using the DELETE method instead of GET or POST. The method is queried but the parameters don't seem to be passed up - I can see this when I inspect the request URL in firebug. Here's what the code looks like: $.ajax({ type:"DELETE", url:"/api/deleteGame", dataType:"json", data: "gameId=" + gameId + "&userId=" + userId, success:function(json) { if(json != null && json.errors == undefined) { alert("Game successfully deleted"); parent

c# http Post not getting anything in webresponse

℡╲_俬逩灬. 提交于 2020-01-05 03:05:24
问题 Here's my code for Request and Response. System.IO.MemoryStream xmlStream = null; HttpWebRequest HttpReq = (HttpWebRequest)WebRequest.Create(url); xmlStream = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(format)); byte[] buf2 = xmlStream.ToArray(); System.Text.UTF8Encoding UTF8Enc = new System.Text.UTF8Encoding(); string s = UTF8Enc.GetString(buf2); string sPost = "XMLData=" + System.Web.HttpUtility.UrlDecode(s); byte[] bPostData = UTF8Enc.GetBytes(sPost); HttpWebRequest

How to “render” HTML without WebBrowser control

匆匆过客 提交于 2020-01-04 16:58:31
问题 First at all - I don't know if "render" is the right word. I like to get information from an website. At the moment therefore I use the WebBbrowser control. Now I like to use HttpWebRequests because I think, that's much faster and threading could be used more easily. But I can't use them, because the HTML-output string I receive from HttpWebRequest has got a lot of JavaScript inside from which the information, that I need, will be created. The web browser "renders" the JavaScript to readable

Conversion of VB6 HTTP request to VB.Net 2.0

落花浮王杯 提交于 2020-01-04 12:34:57
问题 I'm attempting to update a legacy VB6 component (not written by me) to the .NET platform. There is one function which posts an XML string to a URL: Function PostToUrl(ByRef psUrl, ByRef psData, Byref psResponseText, ByRef psErrorMsg, ByRef psUsername, ByRef psPassword) On Error Resume Next Dim objWinHTTP PostToUrl = False psErrorMsg = "" psResponseText = "" Dim m_lHTTPREQUEST_SETCREDENTIALS_FOR_SERVER m_lHTTPREQUEST_SETCREDENTIALS_FOR_SERVER =0 Set objWinHTTP = CreateObject("WinHttp

Conversion of VB6 HTTP request to VB.Net 2.0

牧云@^-^@ 提交于 2020-01-04 12:33:05
问题 I'm attempting to update a legacy VB6 component (not written by me) to the .NET platform. There is one function which posts an XML string to a URL: Function PostToUrl(ByRef psUrl, ByRef psData, Byref psResponseText, ByRef psErrorMsg, ByRef psUsername, ByRef psPassword) On Error Resume Next Dim objWinHTTP PostToUrl = False psErrorMsg = "" psResponseText = "" Dim m_lHTTPREQUEST_SETCREDENTIALS_FOR_SERVER m_lHTTPREQUEST_SETCREDENTIALS_FOR_SERVER =0 Set objWinHTTP = CreateObject("WinHttp