http

how do i do authentification on android

Hi, I need to authenticate to use a rest web service. I make a HttpClient httpclient = new DefaultHttpClient(); an there must be a way to use UsernamePasswordCredentials on that client. Can somebody please point me to a relevant example? I have found some source code uding the HttpClient class in the org.apache.commons.SOMETHING...

Is there a way to set up simple http authentication for an app on heroku?

I want to set up a private staging server on heroku using simple http authentication. Is that possible? ...

Not calling Response.Flush still sends Connection: Close in the Response

I was under the impression that not calling Response.Flush would ensure that Connection: Close would not be returned. So how do I return Connection: Keep-Alive? I am using the following code to return a file from ASP.NET. Response.ContentType = type; Response.AppendHeader("Content-Length", bytes.Length.ToString()); Response.Cache.SetCa...

C++ POST Form Data.

I was able to do this in perl, so now I'm trying to give it a shot in c++. My goal is to submit a md5 hash to http://md5crack.com/crackmd5.php and receive the plaintext back. Correct me if I'm wrong, but to do this you need to send the header information. I'm not exactly sure how to go about this so I broke it up into separate string var...

KSoap-Android\JCIFS sends empty HTTP post

I created an NTLM authenticating SOAP client based on KSOAP-Android and JCIFS. The implementation looks something like this: public class NtlmServiceConnection implements ServiceConnection { public NtlmServiceConnection(final SoapConnectionInfo connectionInfo, String path) { httpclient = new DefaultHttpClient(); ...

Why are there non-breaking spaces in my page title?

I'm injecting a script via JSONP and using it to call a method in my web application like so: (function jsonp(src){ var b = document.body; var t = document.title; var u = encodeURI(document.location.href); var o = document.getElementById('srv-call'); o && b.removeChild(o); var s = document.createElement('script...

How to hide urls from appearing in the address bar (using javascript)

Hello all, I am developing an embedded web server. Now, I have an access validation page (e.g. http://192.168.1.1/) at the very start that accepts username and password and validates it and later redirects the users to the actual device control web page (http://192.168.1.1/devicecontrol.html). I do not want the actual url to appear on t...

How does the HTTP protocol work exactly?

I thought I had this all figured out, but now that I'm writing a webserver, something is not quite working right. The app listens on a port for incoming requests, and when it receives one, it reads everything up to the sequence "\r\n\r\n". (Because that signifies the end of the headers - yes, I am ignoring possible POST data.) Now, aft...

BlackBerry java.io.IOException: No tunnels to open

Hello. I wrote a simple BB app that does an HTTP Request and downloads some JSON encoded information. When I run it on the emulator with the ";deviceSide=true" after the URL it works OK. But when I tried it in my BlackBerry Storm actual device, I got the following exception: java.io.IOException: No tunnels to open Here's the code I u...

HTTP/1.1 500 Internal Server Error while sending data using post method.

I am working on an SMS Sending application and for login purpose i want to send the username and password using POST method from my Android Application to the web server. When i click on login button the application is not resopnding and the console prints the following message in response of the Post request. HTTP/1.1 500 Internal Se...

How to interact with sites in wp7?

I need to send and receive get post requests ...

Are there any efficiency beneftis to PUT and DELETE HTTP methods?

Most of the Web servers and frameworks support by default GET and POST HTTP methods and do not promote or even disallow usage of PUT and DELETE methods. I know using the latter is conceptually more appropriate and e.g. minimizes the URL scheme of the site, but are there actually any concrete efficiency benefits involved (like less reques...

Including Twitter Widgets.js via HTTPS

Hey all I'm having a minor problem with Mixed-content on HTTPS served pages on our site, when we include the http://platform.twitter.com/widgets.js Apparently Twitter doesn't have a valid certificate -- but hopefully I am mistaken. Do any of you have a solution to the problem. I've searched here and on google for a related problem, an...

How to unit-test an event loop?

Hi there, I'm programming an HTTP proxy in Python (transparent proxy for request/response monitoring). But as a TDD adopter, I'm starting the project with HTTP inputs that should be caught by a TCP server. But, as any server, it must run within an event loop, so that it can listen in a specific port. Well, since starting the event loop...

How to pass query string parameters to the PHP binary?

I am developing a webserver that invokes the PHP binary (via CGI) to process a script. Here's the problem: The PHP script isn't picking up the command line parameters. For example, if the client requests path/to/file.php?test=value, the $_GET array is empty. I have tried passing the parameters in an environment variable (QUERY_STRING)...

Amazon s3 signed url upload from java.

Hello, sry for my English, i'm bad at it. My problem is: I generate signed Upload link to amazon signedUrl = StorageConnection.getInstance().getS3Service().createSignedPutUrl(buck_name, KeyID, null, expiryDate); And i want to upload at this from other program, zipping file at stream: private void put(String link, InputStream stream) ...

HttpClient POST gets html page about 2.5x slower than browser

When I hit Search on London journey planner (e.g from Holborn to Savoy Pier), I get result in about 4 secs. When I do that with HttpClient using POST method, this line takes about 10 secs: InputStream is = httpClient.execute(httpPost).getEntity().getContent(); Any ideas what can be the problem? I'm sending the same parameters as brows...

Cache-control: private and public

What should a http client do if server returned Cache-Control: private, public ? I have a feeling private should override public, but I can't find a confirmation in the RFC (other than MUST in private and MAY in public). ...

Content-Length header with HEAD requests?

The http spec says about the HEAD request: The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. Should the response to a HEAD...

Hidden HTTP Post in Javascript

Hi, I'm trying to do an HTTP Post using Javascript. I'm using the code reported here: http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit and it works fine. But I need to remain in the same page while the HTTP Post is sent. How can I do? Thx ...