http

is this a bug in .Net4? HTTP POST on XP and windows 7

using the following code in win7 and vista all is ok: WebClient client = new WebClient(); //specify an encoding for uploading. client.Encoding = System.Text.Encoding.ASCII; // Upload the data. var myReply = client.UploadValues(address, data); reply = System.Text.ASCIIEncoding.ASCII.GetString(myReply); however when running the...

RESTful request to Rails app using curl ignores AuthenticityToken

Is there any reason that AuthenticityToken would be ignored when executing a REST HTTP request using curl? curl http://localhost:3000/Asset/9f3cb180-e410-11de-8a39-0800200c9a66.xml -X DELETE The above will execute remove an Asset of the given ID from the database with no regards to what the AuthenticityToken is (usually nil). class ...

Amazon basic domain/service architecture

Can someone explain what is happening in this URL? (I pulled it off a basic Amazon search and shortened the url= portion) http://www.amazon.com/s/ref=nb_sb_noss?url=whatever My mains questions are, where is the file extension of the requested page ? Is the requested page indeed nb_sb_noss ? What sort of server architecture allows thi...

TcpClient sometimes needs to wait a few hundred milliseconds to be able to send

Hello everybody. I've got quite a weird problem. I'm writing a wrapper for TcpClient to send and receive HTTP requests. The main reason I don't use the built-in WebRequest is because I need a support for SOCKS proxies, and WebRequest does not support it. Anyway, in one of my tests(That use no proxy, just ordinary TcpClient), I've got a...

Simple Java Server with PrintWriter - problem sending a response to browser

Hi, I've just started looking at HTTP etc. and have written a simple Java Client that uses URLConnection to send a URL to a server and pulls down the index.html page (as plain text). Now I'm working on a simple server but I'm stuck at the first hurdle, (well maybe 2nd or 3rd), I can't get it to respond to the client properly. Here is ...

HTTP POST and graceful degradation

I have a web application which among other things contains a table of items created using an Ajax callback. A bunch of form fields at the top of the table allow me to filter the items that will be displayed in the table according to various criteria and show it. Some parts of the table have lists of items with an [X] marked next to the...

using curl or wget commandline to download files

Hi all, I apologize if this question was asked earlier and if its a simple one. I am trying to download a file from http website onto my unix machine using command line.I log onto this website using a username and password. Say I have this link (not a working link) http://www.abcd.org/portal/ABCPortal/private/DataDownload.action?downl...

Form uploading files to different server without following

How can I send a file in django to a different server without user being redirected to the server ? So all goes to rewriting this simple php function in django : $filename = 'C:/tmp/myphoto.jpg'; $handler = 'http://www.example.com/upload.php'; $field = 'image'; $res = send_file($filename, $handler, $field); if ($res) { echo 'do...

Reading RSS feed, end of reader before end of data.

I'm coding this in Java for an Android device. I'd just like to read all of the data in the RSS feed and then I have a parser ready to act on the data. The trouble I'm getting is that only a small portion of the data is ever being read by my code. It then says the end of the reader has been reached and proceeds to return the partial data...

Rails 3 Layout + Querystring Problem

I'm trying to setup an ajax-based website that loads a fragment of a webpage when a specific combination of GET variables and HTTP Headers are given. GET /normal/html/page?ajax=true X-ajax: true What I've setup in my controller is: before_filter do |controller| if request_by_ajax? ApplicationController.layout false end end ...

How to maintain a persistent http connection in php?

hi, i've a little web interface which uploads a file on a server and then dumps that file in oracle db. but there are about 7 million records in it and web server get time out while reading and dumping that file. can someone please tell me how can i keep that session alive so that it doesn't get timeout when uploading, reading and dump...

Using python sockets to receive large http requests

I am using python sockets to receive web style and soap requests. The code I have is import socket svrsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = socket.gethostname(); svrsocket.bind((host,8091)) svrsocket.listen(1) clientSocket, clientAddress = svrsocket.accept() message = clientSocket.recv(4096) Some of the soa...

org.apache.http.auth Problem

Hi, I used org.apache.http.auth and develop demo code samples like this: DefaultHttpClient httpclient = new DefaultHttpClient(); httpclient.getCredentialsProvider().setCredentials( new AuthScope("www.yemeksepeti.com", 80), new UsernamePasswordCredentials("*******", "*******")); BasicHttpContex...

Logging in to HTTPS from HTTP?

As part of a master page template, several sites include a login control. Since the site is served over HTTP, I want the login control, once a successful login has been achieved, to resolve to a portal served over HTTPS. The closest I've seen to achieve this may be here, but I'm not entirely clear on its implementation. Can I get some...

Are %20 and + the same in a http url?

I know that %20 and + both decode to the same binary value (a space), and for most webservers, especially those that map to physical files they will point to the same resource. But my question is, must a url like http://www.example.org/hello%20world point to the same resource as http://www.example.org/hello+world, are they canonically t...

Merge two mp3 php

Hello, Do you know a class to merge two mp3 in php ? I've found nothing serious on google. Thank you ! ...

Canonical URLs for JS and CSS, HTTP vs HTTPS

I am using the IIS Search Engine Optimization Toolkit to scan over a site of mine. One of the compaints it has is that there are multiple canonical URLs for my static assets, e.g. http://example.com links to http://example.com/styles.css https://example.com links to https://example.com/styles.css It is of course correct, the same fi...

Http Get and Post method exceptions in android?

I am using Http get and post methods for Http Connection I just wanted to ask that what all exception can occur in using them. I know list may be too long but can someone tell me the general and frequent exceptions that occur and must be handled? my code is : public class httpconnection { HttpClient client=new DefaultHttpClient...

In IIS7.5 what module removes the body of a 400 Bad Request

I have written ASP.NET (4.0) code that sets the Reposonse.StatusCode to 400 if the data posted to the server is in valid. I place useful information in the response body in the format that the request accepts header asks for. eg an html message saying "The date field is required...". In IIS7 (7.5.7600) on Windows 7 I get the correct htm...

How to add header for http request

I am new to Restlet development, trying to add headers to do a HTTP request. I tried the following code, but got "400 bad request, the header is not valid" String url = "http://xxxxx"; Client c = new Client(Protocol.HTTP); Request request = new Request(Method.GET, url); HashMap attributes = new HashMap(); attributes.put = ("DeviceID",...