http

PHP file get contents with URL returns getaddrinfo failure

Hello, I am trying to get the (pre-processed) content of an external PHP file: file_get_contents('http://www.example.org/myfile.php'); When I do this, I get an error: Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applicatio...

How to get final URL after following HTTP redirections in pure PHP?

What I'd like to do is find out what is the last/final URL after following the redirections. I would prefer not to use cURL. I would like to stick with pure PHP (stream wrappers). Right now I have a URL (let's say http://domain.test), and I use get_headers() to get specific headers from that page. get_headers will also return multiple ...

How to view the last GET HTTP request in JavaScript

How can I view the last GET http request in JavaScript? Basically what I am after is what I can see my firebug console. When XMLHttpRequests are showing in console I see a line that looks something like: GET http://www.domain.com/php/file.php?q0&c=1 200 OK 163ms How do I view that URL in JavaScript? EDIT: Just to be clear...

Create HTTP packet

Hello there, I would like create HTTP packet with random IP source. Apparently, Pcap.net does it. I asked here : http://pcapdotnet.codeplex.com/Thread/View.aspx?ThreadId=227725, but I still have not figured out how to do it. Anybody to help me to write code ? I'm ready to do it in other langage than C#. Thank you ...

Google Geocoding API request_denied

I am trying to geocode a batch of around 400 addresses using the Google Geocoding API through my rails app. In one of my controllers I have these lines require "net/http" require "uri" uri = URI.parse("http://maps.googleapis.com/maps/api/geocode/json?") response = Net::HTTP.post_form(uri, {"address" => '5032-forbes-ave', 'sensor' => '...

How to choose which port to use for a service? (windows & .net)

I'm writing a windows service which will expose an http RESTful web service for other processes on the machine. This will be deployed to lots of machines on various corporate desktops that I have little/no control over. How should I choose which port my service should listen on? I'll make it configurable, but need to know how to choose...

Need async http client(NIO) which supports http/socks proxy

Hi! I seek some full featured async http client (using NIO, not thread per connection), that supports connections through all kinds of proxy(http/https/socks4/socks5). I need different proxy per connection, not one global proxy for all connections. so... what library i can use? P.S. sorry for my english ...

"Ad-hoc webserver" for static files on UNIX/MacOSX?

Is there such a thing as a tiny little webserver that I can invoke from the command line that just fetches files from the local filesystem and serves them via HTTP on specific port? I'd like to be able to do something like this: $ cd ~/Sites/mysite $ serve . 10.0.1.1 8080 This should fire up a webserver that listens on 10.0.1.1:8080 ...

Strange exception on WCF endpoint launch

Hey there! I am getting the following exception and don't have much clue about what and how it should be fixed: The operation 'ShowData' could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that has MessageContractAttribute and other parameters of different types. When usi...

Spring 3.0 HEAD Requests

Hi recently we moved to spring 3.0 Controller handling like this: @Controller public class MyController { @RequestMapping(method = RequestMethod.POST) protected String onSubmit ( Form form, Errors errors) { // handle POST } @RequestMapping(method = RequestMethod.GET) protected void getForm ( Form form ) { ...

java.net.URI chokes on special characters in host part

Hi, I have a URI string like the following: http://www.christlichepartei%F6sterreichs.at/steiermark/ I'm creating a java.lang.URI instance with this string and it succeeds but when I want to retrieve the host it returns null. Opera and Firefox also choke on this URL if I enter it exactly as shown above. But shouldn't the URI class...

Efficient method to generate UUID String in JAVA (UUID.randomUUID().toString() without the dashes)

Hello, I would like an efficient utility to generate Unique sequences of bytes. UUID is a good candidate but UUID.randomUUID().toString() generates stuff like 44e128a5-ac7a-4c9a-be4c-224b6bf81b20 which is good as long as you don't need to transmit it over http, in which casa the dashes need to be removed. I'm looking for an efficient w...

Is There a Table That Shows HTTP Method Support by Browser

I've seen lots of stuff that generally say "not all browser support all HTTP methods" etc., but is there a nice table that shows specifically which HTTP methods are support that's broken down by browser? I see this previous question on SO but it's not the answer I'm looking for: http://stackoverflow.com/questions/3218053/fine-grained-re...

Multiple Set-cookie headers in HTTP.

I'm writing a small class that acts as a very basic HTTP client. As part of a project I'm working on, I'm making it cookie aware. However, it's unclear to me what happens when my client receives multiple "Set-Cookie" headers with the same key but different values are set. For example, Set-Cookie: PHPSESSID=abc; path=/ Set-Cookie: PHP...

How to abort async http connection in iphone ?

I initiated an async http call to the server in a viewcontroller, but it take long time sometimes. Can I put a button on it and then abort the running http call when user clicked that button ? and if that could be done, I'd like also implement this function when user exit current view like, navigate back to its parent view. ...

REST vs SOAP - Is SOAP really more secure than REST?

Hi folks, I am not an expert in SOAP, but from my knowledge SOAP is just an HTTP request formatted in XML in order to supply structured data. I need to implement a simple API with a list of parameters. I proposed using a simple REST interface, but I have been told that SOAP is more secure. Any ideas on this topic? ...

How can I set the port for an iis hosted wcf svc?

Hi All, I have a IIS hosted service http://localhost/someProject/services/myservice.svc . Is it possible to somehow make say http://locahost:9705 point to it? How do I set this up? It seems to be pretty straightforward with a Windows Service hosted WCF service, but I cannot figure how to accomplish this when using .svc files and IIS. In ...

A better C++ HTTP client library

We are looking for a better C++ HTTP client library, and we're willing to pay for it. The product we want needs to be a statically linked, and to work on these platforms: Windows XP, Vista, 7 OS X 10.4, 10.5, and 10.6 We want it to do the following tasks really well: 1. Make HTTP GET and POST requests 2. Handle meta refresh and http re...

Intercept HTTP requests in server java

Hi, I need to implemented something like a filter or listener, that intercepts HTTP requests and retrieves the HTTP headers for various purposes. I use Java, Jboss application server and web services. I want this filtering system to be performed prior to the Web Services call - was thinking about aspects but they do not hold the HTTP r...

Is there a good service for Pinging my web site.

I have a web service that needs to run at 12:00 am ever night. Instead of creating a windows service is there an external service paid or free that I can use to issue a GET to a URL I specify at a specific time every day? ...