Creates a new swatch against the request data.
1 min
code examples curl request post \\ \ url https //api upstartcommerce com/pim/swatches/swatches \\ \ header 'accept application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); var requestoptions = { method 'post', headers myheaders, redirect 'follow' }; fetch("https //api upstartcommerce com/pim/swatches/swatches", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "net/http" url = uri("https //api upstartcommerce com/pim/swatches/swatches") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" response = https request(request) puts response read body import requests url = "https //api upstartcommerce com/pim/swatches/swatches" payload = {} headers = { 'accept' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successfully created a new swatch against the received data in request { "swatchid" "" }