Product Documentation articleOperation tunneling: lq851
Added by IBM contributorRui BJ Yang | Edited by IBM contributorDana Liburdi on April 18, 2011 | Version 3
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.

Overview


When PUT and DELETE requests cannot be made directly, they can be tunneled via POST requests. This implementation looks for a special header X-Method-Override to identify the intended operation in a POST request. Below is an example of a PUT request that is tunneled via a POST request.

Put Request


A PUT request like this:

PUT /dm/atom/library/_Pplace2_RMain.nsf/folder/_Pplace2_RMain_F7F4DAB5FEAAF85FF4825785700212921/feed?noAuthHeader=true  HTTP/1.1
Host: example.com
Content-Type: application/atom+xml

<?xml version="1.0" encoding="utf-8"?>
 <a:entry xmlns:a="http://www.w3.org/2005/Atom">
  <title type="text">folder2</title>
  <category term="folder" scheme="tag:ibm.com,2006:td/type" label="folder"></category>
  <td:type>simplelist</td:type>
  <td:subtype></td:subtype>
  <summary type="text">add a summary</summary>
 </a:entry>

Can be made like this:

POST /dm/atom/library/_Pplace2_RMain.nsf/folder/_Pplace2_RMain_F7F4DAB5FEAAF85FF4825785700212921/feed?noAuthHeader=true  HTTP/1.1
Host: example.com
Content-Type: application/atom+xml
X-Method-Override: PUT

<?xml version="1.0" encoding="utf-8"?>
 <a:entry xmlns:a="http://www.w3.org/2005/Atom">
  <title type="text">folder2</title>
  <category term="folder" scheme="tag:ibm.com,2006:td/type" label="folder"></category>
  <td:type>simplelist</td:type>
  <td:subtype></td:subtype>
  <summary type="text">add a summary</summary>
 </a:entry>


Delete Request


And, a DELETE request like this:

DELETE /dm/atom/library/_Pplace3_RMain.nsf/page/_Pplace3_RMain.nsf_D17BD10855A7CD45785257774006243C6/entry  HTTP/1.1
Host: example.com


Can be made like this:

POST /dm/atom/library/_Pplace3_RMain.nsf/page/_Pplace3_RMain.nsf_D17BD10855A7CD45785257774006243C6/entry HTTP/1.1
Host: example.com
X-Method-Override: DELETE


If the client is unable to set an HTTP request header, a URL argument is also supported for X-Method-Override. If both the header and URL argument are specified, the header takes precedence.