URL Req

Service for echoing a HTTP response defined in the request

Overview

URL Req is an HTTP proxy service that makes a HTTP request based on parameters defined in the URL of the request it received, and returns the response.

The service expects a definition of a HTTP request message in the URL of a request to the service. The service decodes the HTTP request defined in the URL, performs the decoded HTTP request and returns the received response as the response of calling the service. In essence, the service translates the definition of a HTTP request encoded in the URL to a real HTTP request. Furthermore, the service sets the cross-origin resource sharing headers so that it may be invoked from a Web applications executing in browsers.

The URL Req service is implemented and provided as public, open-source and free to use AppEngine service.

Service API

The service is available at http://urlreq.appspot.com/req.

The API defines how a HTTP request should be encoded in the service request URLs. Element of a HTTP request are encoded as URL query parameters:

which makes a POST HTTP request to the GitHub markdown API url https://api.github.com/markdown/raw with the body **Hello** _World_ and a HTTP header setting the Content-Type to text/plain. This response is HTML rendering of the input Markdown text.

URL builder

Instead of constructing URLs by hand, use the handy form below.

Request method:

Request URL:

Request headers (one per line):

Request body:

Output URL Req URL (select all, then copy):

Motivation

The purpose of the service is to assist developers in two situations:

a Web service exposes an interface for calling webhooks on certain events, but the interface allows that only the URL be specified while the body is usually predefined (e.g. the GitHub generic post-commit webhook). Since the URL Req service is a proxy that reads a full HTTP request from the requesting URL, specifying that HTTP request in the URL of the webhook interface is all you need to make any kind of HTTP request.

a Web application executing in the browser must make cross-origin request to an API which does not currently implement CORS headers and is therefore inaccessible. Since the URL Req service always enables cross-origin calls, the service may be used as a proxy for invoking such APIs.

PSHBping

PSHBping is a special case of the URL Req service which enables a simplified API for specifying a HTTP request for notifying a PubSubHubbub hub.

which makes a POST HTTP request to http://pubsubhubbub.appspot.com with a HTTP header setting the Content-Type to application/x-www-form-urlencoded and has the body: hub.mode=publish&hub.url=http%3A//www.feed1.org/atom&hub.url=http%3A//www.feed2.org/atom (which is the required request format for notifying a PSHB hub that the feeds http://www.feed1.org/atom and http://www.feed2.org/atom have new content).

PSHBsub

PSHBsub is a special case of the URL Req service which enables a simplified API for specifying a HTTP request for subscribing to and unsubscribing from a topic on a PubSubHubbub hub.

which makes a POST HTTP request to http://pubsubhubbub.appspot.com with a HTTP header setting the Content-Type to application/x-www-form-urlencoded and has the body: hub.mode=subscribe&hub.topic=http%3A//www.feed1.org/atom&hub.callback=http%3a//requestb.in/p3quq4p3&hub.verify=async.