-
Notifications
You must be signed in to change notification settings - Fork 81
API functional testing
You need to install the Python httpie
package. Then you can do:
http POST https://platform-staging.cadasta.org/api/v1/account/login/ username=<whatever> password=<whatever>
You'll get a response with an authentication token. You can then make other requests using this, by saying things like
http GET https://platform-staging.cadasta.org/api/v1/organizations/
http POST https://platform-staging.cadasta.org/api/v1/organizations/ Authorization:"Token <token-value>" name="My Test Org"
The things in the command line introduced with a colon go into HTTP headers, and the things introduced with an equals sign go into the POST body as fields in a JSON object.
This ought to be an easier option, but I'm having a hard time getting the current version to work... Maybe someone else wants to write some notes?
You can test individual endpoints using a browser interface. To access the GUI, type the URL of the endpoint into your browser's address field.
The interface uses session authentication. To authenticate a request with a user you need to log the user in via the standard login form of the platform.
Visit our User Documentation to learn more about using the Cadasta Platform.
If you'd like to contribute to the Cadasta Platform, start with our Contributing Guidelines.
Cadasta Wiki Home | Developer Setup Guide
Cadasta.org | About Cadasta | YouTube | Twitter | Facebook
- Installing & Running
- Contributing
- Planning & Sprints
- Platform Development
- Testing
- Utilities
- Outreachy
- Platform Site Map
- User Flows and Wireframes
- Other
- Quick Start Guide
- Glossary
- Questionnaire Guide