def METHOD_NAME(self, request, resourceid: int) -> http.HttpResponse:
    put_data = json.loads(request.body)
    with transaction.atomic():
        resource = get_object_or_404(
            Spappresource,
            pk=resourceid,
            spappresourcedir__collection=request.specify_collection,
            **self._spappresourcefilter(request),
        )
        resource.name = put_data['name']
        resource.mimetype = put_data['mimetype']
        resource.metadata = put_data['metadata']
        resource.save()
        data = resource.spappresourcedatas.get()
        data.data = put_data['data']
        data.save()
    return http.HttpResponse('', status=204)