http

Request Error (invalid_request) - Android Browser

I have a basic Jetty server running locally. If I pull up http://localhost/servlet1 in a web browser on my desktop, I am able to see proper content (basic html page). However, when I navigate to this site in the Android Emulator (2.2), I get the following error: Request Error (invalid_request) Your request could not be processed. ...

Don't load hidden images

I have a bunch of hidden images on my website. Their container DIVs have style="display: none". Depending on the user's actions, some images may be revealed via javascript. The problem is that all my images are loaded upon opening the page. I would like to put less strain on the server by only loading images that eventually become visibl...

content-length when using http compression

The client is making a range request 0-1023 to the http server. It prefers gzip compression with Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0 in the request. What would be the content-length in the response header? Will it be 1024 or the size of the compressed data. Thanks, ...

Why recv() in winsock client cannot get any data once httpRetransmition happens?

Hi guys, I am trying to record the time between 'http request' package and 'http response' package. I write an socket client using winsock. The code is below if (send(sock, request.c_str(), request.length(), 0) != request.length()) die_with_error("send() sent a different number of bytes than expected"); //...

REST API design: Tell the server to "refresh" a set of resources

We have a resource on a REST server ie /someResources/1 /someResources/2 /someResources/3 where "someResource" is a server representation of a distributed object far away. We want to tell the server to "refresh" its representation of that "distributed object" by looking at it out in the network & updating the server's cache ie we ca...

Make HTTP connection using GSM network, not WiFi

I need to make HTTP request on Android using GSM connection, not Wifi. My current solution is to disconnect from all wi-fi connections and perform a request. Is there any better solution? I could not find any relevant methods in the API (I looked in package org.apache.http, but it seems it is completely unaware of what type of connectio...

ASP.NET HTTP to HTTPS redirect with www prefix

I am using this simple code to redirect http to https on my billing landing page: if (!Request.IsSecureConnection) { // send user to SSL string serverName =HttpUtility.UrlEncode(Request.ServerVariables["SERVER_NAME"]); string filePath = Request.FilePath; Response.Redirect("https://" + serverName + filePath); } ...

What content-type do I use for http response headers that contain a file attachment of unknown file type?

Right now I am not specifying it and the system is defaulting to text/html which is causing some not so good results like downloading a movie on my iPhone is giving me a massive block of text so large that it crashes the browser for example. What content-type should I use? It could literally be any file type as the attachment. Content-di...

Capture HTTP request packets from my iPhone

I want to monitor the HTTP traffic sent/received from my iPhone. The iphone is connected to the Internet via my wifi router. I want to capture packets from my windows 7 station. Thanks for your help. ...

HTTP response code for POST when resource already exists

I'm building a server that allows clients to store objects. Those objects are fully constructed at client side, complete with object IDs that are permanent for the whole lifetime of the object. I have defined the API so that clients can create or modify objects using PUT: PUT /objects/{id} HTTP/1.1 ... {json representation of the obj...

http json post and rails polymorphic association

I want to update two table of my database with a http post request (JSON format) from my android app. my models look like this: class Ecg < ActiveRecord::Base has_one :record, :as => :payload end class Record < ActiveRecord::Base belongs_to :payload , :polymorphic => true belongs_to :user end an my record cotroller look...

Why does IE submit a POST request when I click <a><button/></a>?

I've got a form that looks like this: <form method="post"> {% csrf_token %} <table> {% for field in form %} {% partial "partials/field.html" field=field %} {% endfor %} <tr> <td></td> <td> <input name="save" type="submit" value="{% if is_new_entry %}Save...

How to see what the browser sends

I need to see exactly what the browser sends to a form, for debugging purposes. I have the "tamper data" addon for Mozilla, but it doesn't show me what I am looking for. What I need is a text file with all that the browser sends, it should look like this: Content-Type: multipart/form-data; boundary=AaB03x --AaB03x Content-Disposi...

Download Tar File via NodeJS

I have two nodejs http servers, one requests a tar file from the other. It works fine via browser testing, but I can never get the second server to glue the chunks together correctly. My attempts with fwrite has been as useless as this // Receives File var complete_file = ''; response.on('data', function(chunk){ complete_file += chu...

Can you explain chunked encoding?

header("Transfer-Encoding: chunked"); echo"32 12345678901234567890123456789012345678901234567890 0 "; flush();exit; When requested with Firefox, 32 and 0 are missing. Why? ...

Passing user credentials from session to an applet?

I have an authenticated user with an HTTP session. The user should be able to use an applet to connect with this authentication to a server. It will connect to server via a socket connection so looking up the session is not possible. How can the authentication be passed? ...

HTTP Headers: What is the difference between X-FORWARDED-FOR, X_FORWARDED_FOR, and HTTP_X_FORWARDED_FOR,

I see various spellings of the non-RFC "XFF" HTTP header used for identifying the IP addresses the request has been forwarded through. Is there a difference between these different header names: X-FORWARDED-FOR, X_FORWARDED_FOR, and HTTP_X_FORWARDED_FOR? Do I need to look for all three? PS - Yes, I know this header can be easily spoofed...

How To Read Files From HTTP POST

How to read files (zip and xml formats) that are delivered to web server from a client application via HTTP POST using java ...

Maintaining N simultaneous HTTP downloads

I have an application that queries a web service by a date range. The web service returns a list of GUID's. I then take each GUID and download a WAV file that it corresponds too. Right now I do it one by one and works fine. What I would like to do is download up to N number of WAV files simultaneously. For some reason I just can not g...

Javascript: What will happen if the size of cookies exceeds the size allocated for Cookies in a Browser ?

The Title says it. ...