Twitter’s REST API uses endpoints that look like this:
In addition for GET request you can append parameters like this:
So for example a call to the Twitter REST might look like this:
I wanted to try and reproduce this format with a REST API I’ve been playing with, so I spent some time figuring out how to configure IIS URL rewrite to handle these URLs and deliver the parameters to an ASP page.
You’ll need IIS rewrite installed, in IIS Manager you should see the ULR rewrite icon if you click on a website, for example:
If the icon is not there download and install URL rewrite extension from the Microsoft website, then open URL Rewrite and add a new Inbound Rule.
Here’s the regular expression pattern I came up with:
With the Rewrite URL of:
This means that a URL like this:
Will pass the parameters into my ASP page like this:
objectTypeName = myObject objectMethod = myMethod param1 = a param2 = b
You need to make sure you have the “Append query string” option checked for the Rule so the additional parameters (eg param1 and param2) are passed through the rewrite.