'Create or replace an object or pseudo-folder
:param request:
:param container:
:param object_name:
If the object_name (ie. POST path) ends in a \'/\' then a folder is
created, rather than an object. Any file content passed along with
the request will be ignored in that case.
POST parameter:
:param file: the file data for the upload.
:return:'

@csrf_exempt
def post(self, request, container, object_name):

    form = UploadObjectForm(request.POST, request.FILES)
    if (not form.is_valid()):
        raise rest_utils.AjaxError(500, 'Invalid    request')
    data = form.clean()
    if (object_name[(-1)] == '/'):
        result = api.swift.swift_create_pseudo_folder(request, container, object_name)
    else:
        result = api.swift.swift_upload_object(request, container, object_name, data['file'])
    return rest_utils.CreatedResponse((u'/api/swift/containers/%s/object/%s' % (container, result.name)))
