View on GitHub

URL Req

Service for echoing a HTTP response defined in the request

Download this project as a .zip file Download this project as a tar.gz file

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:

Furthermore, the parameter names and values must be URL-encoded.

A full service call would look like this:

http://urlreq.appspot.com/req?method=POST&url=https%3a//api.github.com/markdown/raw&body=**Hello**%20_World_&Content-Type=text/plain

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.


Motivation

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

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.

The PSHBping API has the following parameters, as defined in the PSHB protocol spec:

The service is available at http://urlreq.appspot.com/pshbping, so a full service call would look like this:

http://urlreq.appspot.com/pshbping?hub=http%3A//pubsubhubbub.appspot.com&topic=http%3A//www.feed1.org/atom&topic=http%3A//www.feed2.org/atom

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.

The PSHBsub API has the following parameters, as defined in the PSHB protocol spec:

The service is available at http://urlreq.appspot.com/pshbsub so a full service call would look like this:

http://urlreq.appspot.com/pshbsub?hub=http://pubsubhubbub.appspot.com&topic=http%3A//www.feed1.org/atom&callback=http%3a//requestb.in/p3quq4p3&mode=subscribe&verify=async

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.

Credits

URL Req is developed by Ivan Zuzak <izuzak@gmail.com>.

License

Licensed under the Apache 2.0 License.