httpwebrequest

send GET http request from iphone to local web server

旧城冷巷雨未停 提交于 2019-12-25 00:05:47
问题 Hi im working on a application that gives you information about your current location(Country, town,street) so I want to send the town and street to a local web server ! i found a code that technically works when i use this URL : @"http://localhost:8888/jml/save.php?town=California&street=whatever" But what i want is to get the values from a labels (townText/ streetText) and at this point nothing seems to happing ?!! this is the code : if (![self.townText.text isEqualToString:@""] && ![self

Download file from URL with parameters and authentication required

主宰稳场 提交于 2019-12-24 22:43:02
问题 Sorry for disturbing you, but I tried during more than a week and did no find a simple and efficient way to reach this goal, so I'm here to ask your help. I have a recurrent task in my job that follow this steps: Access my company website; Sign-in; Make a search; Download a KMZ file from the search result page. I do it every week and need to download more then 100 files per time, do you know? I have a list with all result I need, so I created an application in c# to automate this process, but

Recieve/Accept file in WEBDAV from httpwebrequest POST or PUT in asp.net

偶尔善良 提交于 2019-12-24 18:26:01
问题 Suppose I have sample Upload file method like this in POStFile.aspx . This method POST file (upload file) to http WEBDAV url. public static void HttpUploadFile(string url, string file, string paramName, string contentType, NameValueCollection nvc) { log.Debug(string.Format("Uploading {0} to {1}", file, url)); string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x"); byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");

Recieve/Accept file in WEBDAV from httpwebrequest POST or PUT in asp.net

前提是你 提交于 2019-12-24 18:24:09
问题 Suppose I have sample Upload file method like this in POStFile.aspx . This method POST file (upload file) to http WEBDAV url. public static void HttpUploadFile(string url, string file, string paramName, string contentType, NameValueCollection nvc) { log.Debug(string.Format("Uploading {0} to {1}", file, url)); string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x"); byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");

.Net Google OAuth token WebRequest Bad Request Protocol Error

旧街凉风 提交于 2019-12-24 17:46:00
问题 I'm doing fine with this OAuth2 stuff until I try to get the token. I think I'm doing something to do with the encoding. Here is my code: string url = "https://accounts.google.com/o/oauth2/token"; StringBuilder postDataBuider = new StringBuilder(); postDataBuider.AppendLine("code=" + code); postDataBuider.AppendLine("client_id=" + System.Configuration.ConfigurationManager.AppSettings["GoogleApplicationClientId"].ToString()); postDataBuider.AppendLine("client_secret=" + System.Configuration

Send Cookies With HttpWebRequest [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-12-24 17:29:27
问题 This question already has answers here : Using CookieContainer with WebClient class (5 answers) Closed 4 years ago . I am attempting to log in to an Ajax chatroom in a website I often visit. I desire to create a moderation bot of sorts, but I am hung up on cookie handling. I have searched through all of the questions on this website, but all solutions seem to do exactly what I am doing, which is setting the CookieContainer parameter of HttpWebRequest to cc . The CookieContainer gets populated

how to handle while multiple push notification comes at same time in foreground of app in iOS

情到浓时终转凉″ 提交于 2019-12-24 16:42:13
问题 I have send request to server in delegate method of application:(UIApplication *)application didReceiveRemoteNotification: but when multiple push notification comes at same time app get crash because of no. of request goes to server. In delegate method I write below code: if (!downloadInboxQueue) { downloadInboxQueue = [[NSOperationQueue alloc] init]; downloadInboxQueue.maxConcurrentOperationCount=1; } NSNumber *ischatnumber=[[NSNumber alloc] initWithInt:0]; operationObject=[[Operation_Inbox

Problem with Httpwebrequest (503)

夙愿已清 提交于 2019-12-24 15:23:56
问题 I am using HttpWebrequest to GET the result from google.I use proxies to get the data.now there is a strange problem that for some queries it return the data and for some it throws the exception The remote server returned an error: (503) Server Unavailable. . One might think that proxy is bad but when you put it in internet explorer then you open google it is there.no 503 error then.but httpwebrequest gives it on certain query.i.e if you intend to get http://www.google.com/search?q=site:http:

The remote server returned an error: (403) Forbidden. during post request…?

南笙酒味 提交于 2019-12-24 14:06:31
问题 I try to make small application for myself and I found this application How to upload video on Dailymotion with c# ?? Is somebody has a complete code? When I tried every thing but publishing is not working. I used fiddler but I cant find the error. Here is the code var request = WebRequest.Create("https://api.dailymotion.com/me/videos?url=" + Uri.EscapeUriString(uploadResponse.url)); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.Headers.Add(

Application hangs on GetRequestStream() after first request

烈酒焚心 提交于 2019-12-24 13:25:52
问题 I've googled and searched here. Some suggest that streams were not being close, others suggested that it's a connection limit with ServicePointManager.DefaultConnectionLimit being set to 1. However, none of these seem to work. My problem is, when i use this for the first time, it works: using (var stream = request.GetRequestStream()) { var data = Encoding.UTF8.GetBytes(post.ToString()); stream.Write(data, 0, data.Length); } When I use it a second time, it freezes. Yes, I'm disposing my stream