public RestResponse Get(RestResource resource) { HttpRequest request = new HttpRequest() { ContentType = "text/plain", ResourcePath = resource.ResourcePath, HttpMethod = HttpMethod.GET }; HttpResponse response = HttpClient.Submit(request); if (response == null) return null; return new RestResponse() { StatusCode = response.StatusCode, Content = response.Content }; }
public RestResponse Delete(RestResource resource) { HttpRequest request = new HttpRequest() { ContentType = "text/plain", ResourcePath = resource.ResourcePath, HttpMethod = HttpMethod.DELETE }; HttpResponse response = HttpClient.Submit(request); if (response == null) return null; return new RestResponse() { StatusCode = response.StatusCode, Content = response.Content }; }
public RestResponse Delete(RestResource resource) { var request = new HttpRequest { ContentType = "text/plain", ResourcePath = resource.ResourcePath, ResourceVersion = resource.ResourceVersion, HttpMethod = HttpMethod.DELETE }; var response = HttpClient.Submit(request); if (response == null) return null; return new RestResponse { StatusCode = response.StatusCode, Content = response.Content }; }
public RestResponse Post(RestResource resource) { HttpRequest request = new HttpRequest() { Content = resource.Content, ContentType = "application/xml", ContentEncoding = Encoding.UTF8, ResourcePath = resource.ResourcePath, HttpMethod = HttpMethod.POST }; HttpResponse response = HttpClient.Submit(request); if (response == null) return null; return new RestResponse() { StatusCode = response.StatusCode, Content = response.Content }; }
public RestResponse Put(RestResource resource) { HttpRequest request = new HttpRequest() { Content = resource.Content, ContentType = "application/xml", ContentEncoding = Encoding.UTF8, ResourcePath = resource.ResourcePath, HttpMethod = HttpMethod.PUT }; HttpResponse response = HttpClient.Submit(request); if (response == null) return null; return new RestResponse() { StatusCode = response.StatusCode, Content = response.Content }; }
public RestResponse Put(RestResource resource) { var request = new HttpRequest { Content = resource.Content, ContentType = "application/xml", ContentEncoding = Encoding.UTF8, ResourcePath = resource.ResourcePath, ResourceVersion = resource.ResourceVersion, HttpMethod = HttpMethod.PUT }; var response = HttpClient.Submit(request); if (response == null) return null; return new RestResponse { StatusCode = response.StatusCode, Content = response.Content }; }
public RestResponse Delete(RestResource resource) { var request = new HttpRequest { ContentType = "text/plain", ResourcePath = resource.ResourcePath, ResourceVersion = resource.ResourceVersion, HttpMethod = HttpMethod.DELETE }; var response = HttpClient.Submit(request); if (response == null) { return(null); } return(new RestResponse { StatusCode = response.StatusCode, Content = response.Content }); }