Forum Discussion
15 years ago
How i can do to post this request:
______________________________
DELETE http://virtualstudio.sandbox3.net/2011- ... API2/Users HTTP/1.1
Accept: */*
Content-Type: application/json; charset=utf-8
Referer: http://virtualstudio.sandbox3.net/2011- ... min/DPAT/#
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: virtualstudio.sandbox3.net
Content-Length: 52
Connection: Keep-Alive
Pragma: no-cache
Cookie: ASP.NET_SessionId=0dpguk2af2iz0rd0vpdedf5o; .ASPXANONYMOUS=Exmjhh5dzAEkAAAAZTFkZWFmMjEtYWE5OS00NDJmLTliZmMtNDVhNDQyMjQ2ZTcy0; .ASPXAUTH=96A4F3BA2F50E80FFC559E4F06DE31B81CCA1251E9FB6F35CCD788D744B0F6DA6295E3E5D80D120FB4CFE235DDBD8229BB820F055F03C70EB61CEDB4336ADCD3839D4EFDCB67BBD8D700F6D58AEDF32E
{"username":"aaaaaaaaa","deleteAllRelatedData":true}
__________________
the problem is how i can send the body-content : {"username":"aaaaaaaaa","deleteAllRelatedData":true}
I try to do with HTTP Method Overloading
REST API uses HTTP GET, POST, PUT and DELETE methods. Since some HTTP clients do not support methods PUT and DELETE, you can simulate them via POST by appending the query string parameter _method (yes, underscore method) to a resource URL. Valid values are PUT and DELETE.
For example, if you want to perform a DELETE request on a particular phone number resource you could:
DELETE /2010-04-01/Accounts/AC30947.../PhoneNumbers/PN12345567789AFE4433
But if your client is only capable of GET and POST, then you could perform a POST with a _method query string variable to achieve the same result:
POST /2010-04-01/Accounts/AC30947.../PhoneNumbers/PN12345567789AFE4433?_method=DELETE
But it do not work with SOAPUI or maybe you can help me to make it work ?
thanks
Spear.
______________________________
DELETE http://virtualstudio.sandbox3.net/2011- ... API2/Users HTTP/1.1
Accept: */*
Content-Type: application/json; charset=utf-8
Referer: http://virtualstudio.sandbox3.net/2011- ... min/DPAT/#
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: virtualstudio.sandbox3.net
Content-Length: 52
Connection: Keep-Alive
Pragma: no-cache
Cookie: ASP.NET_SessionId=0dpguk2af2iz0rd0vpdedf5o; .ASPXANONYMOUS=Exmjhh5dzAEkAAAAZTFkZWFmMjEtYWE5OS00NDJmLTliZmMtNDVhNDQyMjQ2ZTcy0; .ASPXAUTH=96A4F3BA2F50E80FFC559E4F06DE31B81CCA1251E9FB6F35CCD788D744B0F6DA6295E3E5D80D120FB4CFE235DDBD8229BB820F055F03C70EB61CEDB4336ADCD3839D4EFDCB67BBD8D700F6D58AEDF32E
{"username":"aaaaaaaaa","deleteAllRelatedData":true}
__________________
the problem is how i can send the body-content : {"username":"aaaaaaaaa","deleteAllRelatedData":true}
I try to do with HTTP Method Overloading
REST API uses HTTP GET, POST, PUT and DELETE methods. Since some HTTP clients do not support methods PUT and DELETE, you can simulate them via POST by appending the query string parameter _method (yes, underscore method) to a resource URL. Valid values are PUT and DELETE.
For example, if you want to perform a DELETE request on a particular phone number resource you could:
DELETE /2010-04-01/Accounts/AC30947.../PhoneNumbers/PN12345567789AFE4433
But if your client is only capable of GET and POST, then you could perform a POST with a _method query string variable to achieve the same result:
POST /2010-04-01/Accounts/AC30947.../PhoneNumbers/PN12345567789AFE4433?_method=DELETE
But it do not work with SOAPUI or maybe you can help me to make it work ?
thanks
Spear.