Skip to content

Instantly share code, notes, and snippets.

@Nasiek
Created May 10, 2022 20:19
Show Gist options
  • Save Nasiek/ed9dc5ae92d045dd6b4268033d02c4eb to your computer and use it in GitHub Desktop.
Save Nasiek/ed9dc5ae92d045dd6b4268033d02c4eb to your computer and use it in GitHub Desktop.
fetch watershed
const staging ="https://watersheds-staging.cci.drexel.edu/api/watershedboundary/"
tst= {"type":"Polygon", "coordinates":[
[77.73296229004495, 41.678725253048356],
[-77.73296229004495, 41.67398057065239],
[-77.72480719166349, 41.67398057065239],
[-77.73296229004495, 41.678725253048356]
]}
fetch(staging,{method:"POST",body:JSON.stringify(tst),headers:{"Content-type":"application/json; charset=UTF-8"}}).then(response=>response.json()).then(json=> console.log(json)).catch(err=> console.log(err));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment