function update_location($args, $apidata) {
parent::handle($args);
+ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']);
+ exit();
+ }
+
$location = trim($this->arg('location'));
if (!is_null($location) && strlen($location) > 255) {
function create($args, $apidata) {
parent::handle($args);
+ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']);
+ exit();
+ }
+
$id = $apidata['api_arg'];
$other = $this->get_user($id);
function destroy($args, $apidata) {
parent::handle($args);
+
+ if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) {
+ $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']);
+ exit();
+ }
+
$id = $apidata['api_arg'];
# We can't subscribe to a remote person, but we can unsub
parent::handle($args);
+ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']);
+ exit();
+ }
+
$user = $apidata['user'];
$status = $this->trimmed('status');
$source = $this->trimmed('source');