API.Post¶
-
static class
Post
¶
Methods¶
event¶
POST to the server a request, via
/event/new
, to create a newEvent
. Success or failure status will be passed via aNetworkResponse
to the listener.Parameters: - queue – Queue to which the asynchronous task will be added
- event –
Event
to create. - listener – Listener whose onResponse method will be called when task completes
joinEvent¶
Add a user to an existing event. This operation requires authentication, so the user must be logged in.
Parameters: - queue – Queue to which the asynchronous task will be added
- settings –
SharedPreferences
instance so we can get the token. - eventId – ID of the event to add the user to
- listener – Listener whose onResponse method will be called when the operation completes
joinNetwork¶
Add the current user to an existing network. This operation requires authentication, so the user must be logged in.
Parameters: - queue – Queue to which the asynchronous task will be added
- networkId – ID of the network to add the user to
- listener – Listener whose onResponse method will be called when the operation completes
leaveEvent¶
Removes user from event subscription listing.
Parameters: - queue – Queue to which network request will be added.
- eventId – id of event to remove user from.
- settings –
SharedPreferences
instance that stores token. - listener – Listener whose onResponse will be called when the operation completes.
leaveNetwork¶
Remove the current user from a network. This operation requires authentication, so the user must be logged in. If the user is not in the specified network, no error is thrown.
Parameters: - queue – Asynchronous task to which the request will be added
- networkId – ID of the network to remove the user from
- settings – Reference to the
SharedPreferences
storing the user’s login token - listener – Listener whose
onResponse
method will be called when the operation completes
post¶
POST to the server a request, via
/post/new
, to create a neworg.codethechange.culturemesh.models.Post
. Success or failure status will be passed via aNetworkResponse
to the listener.Parameters: - queue – Queue to which the asynchronous task will be added
- post –
org.codethechange.culturemesh.models.Post
to create. - listener – Listener whose onResponse method will be called when task completes
reply¶
POST to the server a request, via
/post/{postId}/reply
, to create a newPostReply
. Success or failure status will be passed via aNetworkResponse
to the listener.Parameters: - queue – Queue to which the asynchronous task will be added
- comment –
PostReply
to create. - listener – Listener whose onResponse method will be called when task completes
user¶
-
static void
user
(RequestQueue queue, User user, String email, String password, Response.Listener<NetworkResponse<String>> listener)¶ POST to the server a request, via
/user/users
, to create a new user. Note that Success or failure status will be passed via aNetworkResponse
to the listener.Parameters: - queue – Queue to which the asynchronous task will be added
- user – User to create. Must have password set.
- email – User’s email address
- listener – Listener whose onResponse method will be called when task completes