MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / postJSON

Function postJSON

data/scripts/examples/ai.js:85–97  ·  view source on GitHub ↗
(endpoint, path, body, cb)

Source from the content-addressed store, hash-verified

83}
84
85function postJSON(endpoint, path, body, cb) {
86 post(endpoint + path, body, function(rsp) {
87 var data, error = rsp.status != 200 ? 'status:' + rsp.status : 0;
88 try {
89 if (!error)
90 data = JSON.parse(rsp.string);
91 else error += rsp.string;
92 } catch (ex) {
93 error = ex;
94 }
95 cb(data, error);
96 });
97}
98
99
100const lorastudio = {

Callers

nothing calls this directly

Calls 2

postFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected