Documentation > CMS Template API Library > Util > DeleteHttp(String,DeleteHttpParams)
DeleteHttp
Sends a DELETE request to the provided URL. Use the DeleteHttpParams object to set optional values for timeout and headers.
public CrownPeak.CMSAPI.DeleteHttpResponse DeleteHttp(String,DeleteHttpParams)
Returns
A DeleteHttpResponse object which contains the response text as well as various meta data about the DELETE request. A Status Code of -900 is returned if a connection to the server could not be established.
Parameters
| Name | Description | Type |
|---|---|---|
| url | The URL. | System.String |
| postHttpParams | The HTTP params. | CrownPeak.CMSAPI.DeleteHttpParams |
Code Example
C#
Sample:
string url = "http://www.crownpeak.com";
DeleteHttpParams deleteHttpParams = new DeleteHttpParams();
deleteHttpParams.TimeOut = 20;
DeleteHttpResponse response = Util.DeleteHttp(url, deleteHttpParams);
if(response.StatusCode >= 200 && response.StatusCode < 300)
{
Out.WriteLine(response.ResponseText);
}