Delete the post, but return the JSON.
970044
def j_delete(self, *args):
        '''
        
        '''

        uid = args[0]

        current_infor = MPost.get_by_uid(uid)
        tslug = MCategory.get_by_uid(current_infor.extinfo['def_cat_uid'])
        is_deleted = MPost.delete(uid)
        MCategory.update_count(current_infor.extinfo['def_cat_uid'])
        if is_deleted:
            output = {
                'del_info': 1,
                'cat_slug': tslug.slug,
                'cat_id': tslug.uid,
                'kind': current_infor.kind

            }
        else:
            output = {
                'del_info': 0,
            }
        return json.dump(output, self)
386156
def delete(self):
        
        res = self.rest_client.session.delete(self.rest_self)
        _handle_http_errors(res)
371522
def delete(self, data, *args):
        
        path = self.get_resource_name()
        result = self.perform_api_call(self.REST_DELETE, path, data=data)
        return result
336058
def delete(self):
        """"""

        start = datetime.now()
        r = requests.delete(self._url(), auth=(self.key, ""))
        self._delay_for_ratelimits(start)

        if r.status_code not in self.TRUTHY_CODES:
            return self._handle_request_exception(r)
112358
def delete(self, endpoint, **kwargs):
        
        kwargs.update(self.kwargs.copy())
        response = requests.delete(self.make_url(endpoint), **kwargs)
        return _decode_response(response)
1101068
def delete(self):
        ''
        #url = '%s?dl=true' % self.path
        r = self.jfs.post(url=self.path, params={'dl':'true'})
        return r
1159276
def delete(self):
        """"""

        response = self.pingdom.request('DELETE',
                                        'reports.shared/%s' % self.id)
        return response.json()['message']
837958
def delete(self):
        
        res = requests.delete(url=self.record_url, headers=HEADERS, verify=False)
        #self.write_response_html_to_file(res,"bob_delete.html")
        if res.status_code == 204:
            #No content. Can't render json:
            return {}
        return res.json()
695832
def delete(self):
        """"""
        check_bind(self)
        if self.id is None:
            raise ServerError("{} object does not exist yet".format(self.__class__.name))
        elif not self.__class__._has_schema_method("destroy"):
            raise MethodNotSupported("{} do not support deletion.".format(self.__class__.__name__))

        try:
            self._resource.delete()
        except HTTPError as e:
            if e.response.status_code == 403:
                raise PermissionDenied("")  # FIXME: is this right?
            else:
                raise e
921422
def dispatch(self, request, **kwargs):
        '''
        
        '''

        # Delete method must happen with POST not with GET
        if request.method == 'POST':
            # Check if this is a webservice request
            self.__authtoken = (bool(getattr(self.request, "authtoken", False)))
            self.json_worker = self.__authtoken or (self.json is True)
            # Call the base implementation
            return super(GenDelete, self).dispatch(request, **kwargs)
        else:
            json_answer = json.dumps({
                'error': True,
                'errortxt': _('Method not allowed, use POST to delete or DELETE on the detail url'),
                })
            return HttpResponse(json_answer, content_type='application/json')
1231955
def delete(self, uri, query=None, **kwargs):
        """"""
        return self.fetch('delete', uri, query, **kwargs)
279299
def delete(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'comment': '',
           'result': True}
    if name in __reg__:
        del __reg__[name]
    return ret
1308455
def delete(self, endpoint: str, **kwargs) -> dict:
        """"""

        return self._request('DELETE', endpoint, **kwargs)
296648
def delete(url)
      params = { url: url }
      options = create_params(params)
      result_code = self.class.get('/posts/delete', options).parsed_response["result"]["code"]

      raise Error.new(result_code) if result_code != "done"

      result_code
    end
318997
def rest_delete(url, timeout):
    ''''''
    try:
        response = requests.delete(url, timeout=timeout)
        return response
    except Exception as e:
        print('Get exception {0} when sending http delete to url {1}'.format(str(e), url))
        return None
152336
function (req, res) {
        var id = req.params.id;
        {modelName}.findByIdAndRemove(id, function (err, {name}) {
            if (err) {
                return res.status(500).json({
                    message: 'Error when deleting the {name}.',
                    error: err
                });
            }
            return res.status(204).json();
        });
    }
967170
def delete_project():
    
    assert request.method == "POST", "POST request expected received {}".format(request.method)
    if request.method == "POST":
        try:
            selections = json.loads(request.form["selections"])
            utils.drop_project(selections["project"])
            return jsonify({"response": "deleted {}".format(selections["project"])})
        except Exception as e:
            logging.error(e)
    return jsonify({"0": "__EMPTY"})