Skip to content

Facebook dev, IIS 5.1, and error 405

In the middle of a Facebook application idea of mine. Using the FacebookToolkit to get something together.

It’s pretty interesting how Facebook integrates with 3rd party applications. Short version: User accesses “http://apps.facebook.com/<appplication_name>”, Facebooks sends your page a POST (you host it wherever you want); Facebook displays the output of your page. Long story: Basic Application Architecture.

You can configure the location of the page Facebook POSTs to – called the Callback Url. I initially had this set to something like: http://www.mycheaphosting.com/Canvas.aspx. The location the Facebook user accesses, i.e. apps.facebook.com/myapplication/ is called the Canvas Page.

Any relative links within your Callback page will become relative to your Canvas page. For example a link to “blah.aspx”, will be treated by the browser as a link to “apps.facebook.com/myapplication/blah.aspx”. What does Facebook do with a URL like this? It POSTs to the same ‘relative’ location on your server. Which in my case would be: http://www.mycheaphosting.com/Canvas.aspxblah.aspx. Yuck!

My first thought was: Okay, I can put the logic into a ‘default.aspx’, and change the Callback URL to: http://www.mycheaphosting.com/.

Have you ever tried to POST to a default document? Under IIS 5.1 – it actually causes a 405 – ‘Resource not allowed’ error. The best reference on this I could find was in this comment from David Wang’s article HOWTO: POST Resources to IIS:

The ability to POST to a DefaultDocument requires IIS6. Prior IIS versions will return “405 Method not Allowed”. That is simply a limitation of the IIS Request Processing Pipeline.

The fix: WebDev.WebServer2
– an alternative to the Cassini web server that comes with VS2005. Unlike Cassini this web server can service external requests.

{ 3 } Comments

  1. Anonymous | February 7, 2008 at 2:41 pm | Permalink

    Is there a way you can sort this programmatically instead of server upgrade

  2. Russ | February 7, 2008 at 11:58 pm | Permalink

    not that I know of.. you could do your coding on a Sever 2003 box.

  3. Ramprasad | March 21, 2009 at 11:09 am | Permalink

    For 405 errors in IE7, check out this link..

    http://dotnetdreamer.com/2009/03/21/azure-services-method-not-allowed-405/

Post a Comment

Your email is never published nor shared. Required fields are marked *