http

How to add parameters to a http post call?

hi all! I'm using the following lines of code to make an http post call NSData *imageData = UIImageJPEGRepresentation(image, 0.9); NSString *urlString = @"http://169.254.225.91:8888/upload.php"; // setting up the request object now NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL ...

looking for good solution to invoke http client method in a bean (i.e. MDB, session)

---[ejb request]--> bean -----[http request]----> host I would like to invoke http client method (http put, get...) within a bean, but I want these beans, either MDB or stateless session bean, run as quick as possible (with extreme short life time). Problem is, the http connection is too slow (especially when connecting to slow host...

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...

HTTP Response 412 - can you include content?

I am building a RESTful data store and leveraging Conditional GET and PUT. During a conditional PUT the client can include the Etag from a previous GET on the resource and if the current representation doesn't match the server will return the HTTP status code of 412 (Precondition Failed). Note this is an Atom based server/protocol. My...

Load balancing and sessions

Hi there, What is the better approach for load balancing on web servers? My services run in .NET and Mono, so they could be hosted on IIS or Apache2, and the will have to provide SSL connection. I've read two main approaches, store the state in a common server and use sticky sessions, there is any other else? I've read 3 diffent thin...

Ho to get PHP setrawcookie value back?

The IETF recommends to use base64 encoding for binary cookie values. http://tools.ietf.org/html/draft-ietf-httpstate-cookie-07 So I use setrawcookie(..) but I don't know what variable to use to get the cookie back because $_COOKIE[..] still uses the URL decoding that matches setcookie(..). This replaces "+" with " " in the output. <?ph...

I'm implement http live streaming video from my webserver to iPhone. Will I get rejected for bandwidth?

Apache webserver setup added: AddType application/x-mpegURL .m3u8 AddType video/MP2T .ts to "httpd.conf" file. Movie file preparation I have 3 movie files (9mb - 25mb each). Used QuickTime to convert movies into iPhone format. Used mediafilesegmenter to convert .m4v into 10-second segments of .ts files, with an accompanying .m3u8 ...

Is there a standard syntax for encoding structure objects as HTTP GET request parameters?

Imagine we need to pass a a number structured objects to the web application - for instance, locale, layout settings and a definition of some query. This can be easily done with JSON or XML similar to the following fragment: <Locale>en</Locale> <Layout> <Block id="header">hide</Block> <Block id="footer">hide</Block> <Block...

In Python, how do I decode GZIP encoding?

I downloaded a webpage in my python script. In most cases, this works fine. However, this one had a response header: GZIP encoding, and when I tried to print the source code of this web page, it had all symbols in my putty. How do decode this to regular text? ...

.Net System.Net.HttpWebRequest & Authentication Cookies

I would like to know if the following is possible: As part of the PageLoad of an ASP.Net page request: Use HttpWebRequest (POST) to make a request to a forms authentication webpage of a different web application Examine the response to see if the authentication succeeded (identifiable if an authentication cookie has been set) If it fa...

javascript prototype errors

i am sending ajax requests after 5 seconds and i have 3 types of requests to send but after few request it starts errrors 401 access denied 501 how to overcome dis ...

Urllib and concurrency - Python

Hi there, I'm serving a python script through WSGI. The script accesses a web resource through urllib, computes the resource and then returns a value. Problem is that urllib doesn't seem to handle many concurrent requests to a precise URL. As soon as the requests go up to 30 concurrent request, the requests slow to a crawl! :( Help...

[.NET][C#] - Is possible to get a web with its links (CSS,JavaScript,Images, CSS-Images) ?

Hi there, I am implementing a CMS, the case is that the "Web-Editable" is in a different domain thus, I would be able just get the page using HttpRequest in order to copy and show it in the CMS server to make it able to change it (DOM just visual purpose) and save the changes to the CSS and JavaScript folder on the "Web-Editable" using ...

C++ Windows IOCP - HTTP POST data missing

I have written a very simple IOCP HTTP server that works for the GET verb, but not POST. I create a socket and a listen thread in which accept() is waiting for a connection. When a client connects I call ioctlsocket() to unblock the socket then I associate the socket with IOCP and finally call WSARecv() to read the data. Some data is i...

.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 validate HTTP request headers before receiving request body using WCF

I'm implementing a REST service using WCF which will be used to upload very large files. The HTTP headers in this request will communicate information which will be validated prior to allowing the upload to proceed (things like permissions, available disk space, etc). It's possible this validation will fail resulting in an error respon...

How to hijack all local http request and extract the url using c?

What direction should I go in(libraries, documents)? UPDATE Can someone illustrate how to use winpcap to do the job? UPDATE 2 How do I verify whether a packet is an HTTP one? ...

How to send a HTTP "Bad Request" Response

Hi, I am writing a C program which needs to send back a HTTP Bad Response. This is what I write to socket. HTTP/1.1 400 Bad Request\r\n Connection: close\r\n \r\n My question is why the broswer still spinning (like appear it is still loading something? Am I missing header in the Http response? OR I miss something else? Thank you. ...

What is the difference between HTTP_USER_AGENT and HTTP_X_USER_AGENT?

I sometimes see one or the other in my server logs. Thank You ...

Sending multipart response for downloads in Zend Framework

I'm sending files in action helper for downloads (in parts if needed) like this: ... $response->sendHeaders(); $chunksize = 1 * (1024 * 1024); $bytesSent = 0; if ($httpRange) { fseek($file, $range); } while(!feof($file) && (!connection_aborted() && ($bytesSent < $newLength)) ) { $buffer = fread($file, $chunksize); // ...