Function
postJSON
(endpoint, path, body, cb)
Source from the content-addressed store, hash-verified
| 83 | } |
| 84 | |
| 85 | function 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 | |
| 100 | const lorastudio = { |
Callers
nothing calls this directly
Tested by
no test coverage detected