Closed aleksa-krolls closed 4 months ago
Looking over those docs it seems there are a few supported formats for the post. But we also already have submit
and submitXls
operations.
I suggest we keep it simple and just post JSON. Users will be able to set their own headers if they wish to upload a differemt format,
So we probably want an API like:
post(path, data, params, callback)
Where data is a JSON array or object.
It should be a very simple function, like get
, which just wraps the existing request handler. The only automation we offer is a) a nice clean API and b) setting up auth according to state.configuration
Sounds good to me!
@aleksa-krolls This is under code review
Request
Add generic
post
function.See docs on CommCare API endpoints we could use this with: https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143957350/User+Creation+Mobile+Worker https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143950677/Submission+API#Submission-as-the-body-of-a-post https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143946023/Bulk+upload+Lookup+Tables
To test
See LP
CommCare Demo Project
for a credential to ourtest
project.