httprequest

Android: How get the status-code of an HttpClient request

I want to download a file from and need to check the response status code (ie HTTP /1.1 200 OK). This is a snipped of my code: HttpGet httpRequest = new HttpGet(myUri); HttpEntity httpEntity = null; HttpClient httpclient = new DefaultHttpClient(); HttpResponse response = httpclient.execute(httpRequest); ... How do i get the status-cod...

Android: howto parse URL String with spaces to URI object?

I have a string representing an URL containing spaces and want to convert it to an URI object. If is simple try to do String myString = "http://myhost.com/media/mp3s/9/Agenda of swine - 13. Persecution Ascension_ leave nothing standing.mp3"; URI myUri = new URI(myString); it gives me java.net.URISyntaxException: Illegal character in...

PHP/Zend: How to force browsers to don't show warnings on webpage for a particular case?

I am trying to get twitter updates like this: try { $doc = new DOMDocument(); $doc->load('http://twitter.com/statuses/user_timeline/1234567890.rss'); $isOK = true; } catch( Zend_Exception $e ) { $isOK = false; } If there is not problem with internet connection then $isOK = true; is set. But if there is a problem in loading t...

Java HTTP Requests Buffer size

Hello, I have an HTTP Request Dispatcher class that works most of the time, but I had noticed that it "stalls" when receiving larger requests. After looking into the problem, I thought that perhaps I wasn't allocating enough bytes to the buffer. Before, I was doing: byte[] buffer = new byte[10000]; After changing it to 20000, it seem...

Is it ethical to let users see the request headers from visitors to a url shortening service?

I'm currently in the progress of making a url shortening service that will let the creator see the http request headers that the browser has made when visitors visit the url. The visitors won't be made aware that they are being tracked, but obviously nothing is personally identifiable. Is there anything I should be made aware of ethica...

Blackberry Asynchronous HTTP Requests - How?

The app I'm working on has a self contained database. The only time I need HTTP request is when the user first loads the app. I do this by calling a class that verifies whether or not a local DB exists and, if not, create one with the following request: HttpRequest data = new HttpRequest("http://www.somedomain.com/xml", "GET", this); d...

asp.net could a half submitted web page be processed?

Having a weird bug in production and just wondering if it's possible for a half submitted web page to processed by the server? The page has no view state just using plain old html controls and accessing data displayed in repeater on the back end via Request.Form[name] etc. Is it possible for a request to be truncated perhaps due to los...

HttRequest without caching

I'm writing a client that is making repeated http requests for xml data that is changing over time. It looks like the Android stack is caching my page requests and returning the same page repeatedly. How do I make sure it gets a fresh page each time? -- code --- HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpG...

.NET - downloading multiple pages from a website with a single DNS query

I'm using HttpRequest to download several pages from a website (in a loop). Simplifying it looks like this: HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create( "http://sub.domain.com/something/" + someString ); HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); //do something I'm not quite sure ...

How to make and check a request with content-type as 'application/json'?

hi all, In my asp.net page I have a webmethod which will return data in json.I would like to run this method only when the http request content-type is 'application/json'.I do not understand how do I make a request with content-type as 'application/json' and how to check if the request content-type is 'application/json'? Please help.. ...

Receiving POST data in ASP.NET

Hi, I want to use ASP for code generation in a C# desktop application. To achieve this, I set up a simple host (derived from System.MarshalByRefObject) that processes a System.Web.Hosting.SimpleWorkerRequest via HttpRuntime.ProcessRequest. This processes the ASPX script specified by the incoming request (using System.Net.HttpListener t...

HTTP Request from a PC to load the contents of a wap site

When I try to load a wap site with PHP HTTP request from my PC, host of the web site recognizes that I'm sending the request from a PC and redirects me to their actual web site and I can't load the wap site. Is there a way to behave like a mobile browser and prevent this redirection? Although an answer regarding any programming language ...

How to set timeout when Unable to connect to the remote server in HttpRequest?

How to set timeout when Unable to connect to the remote server in HttpRequest? ...

How to forward/redirect an HTTP PUT Request with PHP?

Hi, I receive HTTP PUT requests on a server and I would like to redirect / forward these requests to an other server. I handle the PUT request on both server with PHP. The PUT request is using basic HTTP authentication. Here is an example : www.myserver.com/service/put/myfile.xml redirect to www.myotherserver.com/service/put/myfi...

How do I request and process JSON with python?

Hello - I am trying to send a GET request to a URL that I know returns data in the form of JSON using python. I would like to know how to send this request to http://someurl/path/to/json, and how to parse it - preferably to a python dict. thanks :) ...

how website find them the request come from a browser or from any other.

how website checked that a request come from a browser or from a programs. ...

xmlhttprequest responsetext coming for Accept header: text/xml , but server error for application/JSON

I have to get response text from a resourceindex page as JSON object. When I dont put a Accept header in the request, it shows me the xml response (i see it in an alert).. But I want the response as a JSON object.. What should I do. One solution would have been httpRequest.setRequestHeader('Accept', 'application/JSON'); but this give...

HttpRequest maximum length exceeded issue in ASP.net

I'm trying to fix an issue with an application I'm supporting (I didn't write the code). The code takes an SSRS report and renders it in pdf format. Users are sporadically getting the error indicated in the title. There is no rhyme or reason to when the error is generated (a particular report will run one time and throw the error the nex...

Is it possible to make http requests with MATLAB?

Is it possible to make http requests with MATLAB? I am specifically interested in the way to make a request and store the response as a new variable. ...

C# multiple asynchronous HttpRequest with one callback

I want to make 10 asynchronous http requests at once and only process the results when all have completed and in a single callback function. I also do not want to block any threads using WaitAll (it is my understanding that WaitAll blocks until all are complete). I think I want to make a custom IAsyncResult which will handle multiple cal...