Update a Pet
1 min
code examples curl request post \\ \ url https //developer digitail io/api/v1/pets/{id} \\ \ header 'accept application/json' \\ \ header 'x http method override patch'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "multipart/form data"); myheaders append("x http method override", "patch"); var requestoptions = { method 'post', headers myheaders, redirect 'follow' }; fetch("https //developer digitail io/api/v1/pets/{id}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "net/http" url = uri("https //developer digitail io/api/v1/pets/{id}") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "multipart/form data" request\["x http method override"] = "patch" response = https request(request) puts response read body import requests url = "https //developer digitail io/api/v1/pets/{id}" payload = {} headers = { 'accept' 'application/json', 'content type' 'multipart/form data', 'x http method override' 'patch' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful operation { "data" {} }