Skip to content

Add ability to customize sync HTTP method, data format and payload keys#119

Merged
eyedol merged 5 commits intoushahidi:developfrom
aksalj:develop
Aug 29, 2013
Merged

Add ability to customize sync HTTP method, data format and payload keys#119
eyedol merged 5 commits intoushahidi:developfrom
aksalj:develop

Conversation

@aksalj
Copy link
Copy Markdown
Contributor

@aksalj aksalj commented Aug 23, 2013

Add feature for developers to specify how SMSSync communicates with their server.

By default a normal POST request is sent; I needed a PUT or POST request with messages sent in JSON format (with my own keys for the data items) to ease integration with a CouchDB web app.

2013-08-23 21 30 41

@eyedol
Copy link
Copy Markdown
Collaborator

eyedol commented Aug 26, 2013

@aksalj This is a good feature to merge. It will give so much flexibility to developers. How well does this play with web services that have the default implementation - POST only. Is the Sync Scheme tied to a specific Sync URL?

This is a huge pull request. Could you add some test cases?

@aksalj
Copy link
Copy Markdown
Contributor Author

aksalj commented Aug 26, 2013

@eyedol The sync scheme is URL-specific and is by default the original POST with the default payload keys (secret, from, message, message_id, sent_timestamp, sent_to); messages are sent same as before, so current web services should not notice any differences (same goes for app update).

Also, since the SyncScheme class is mostly set/get with no complex logic and is tied to the SyncUrl class, tests on SyncUrl are practically testing SyncScheme as well.

2013-08-26 09 52 05

2013-08-26 09 52 34

2013-08-26 09 53 42

@eyedol
Copy link
Copy Markdown
Collaborator

eyedol commented Aug 26, 2013

@aksalj thanks for the confirmation. Looks good.

Regarding the test cases, I was asking for specific test case when say JSON and PUT has been set as the Sync Scheme.

@aksalj
Copy link
Copy Markdown
Contributor Author

aksalj commented Aug 28, 2013

@eyedol Added a few test on the different sync schemes

@eyedol
Copy link
Copy Markdown
Collaborator

eyedol commented Aug 29, 2013

👍

Would be nice to have you on the CREDITS file. Could you add your details and send a pull request? Thanks.

eyedol added a commit that referenced this pull request Aug 29, 2013
Add ability to customize sync HTTP method, data format and payload keys
@eyedol eyedol merged commit 65eeedb into ushahidi:develop Aug 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants