[已解决]curl命令运行结果如下,该如何修改,谢谢,命令和程序附在下面

curl命令如下:

C:\Users\yingfang>curl -v -H "Content-Type:application/json" -X POST -d "emails=
2&path=/新儒家美学论衡.png&s_type=f"  -u 1@qq.com:1 http://192.168.17.2:8000/rep
os/da3072ba-66ef-4c7f-87c7-c5f189d9c2b2/dir/share

结果截图如下:

图片描述

结果如下

图片描述

请求的服务器程序为(python写的):

class DirShareView(APIView):
authentication_classes = (TokenAuthentication, )
permission_classes = (IsAuthenticated,)
throttle_classes = (UserRateThrottle, )

# from seahub.share.view::gen_private_file_share
def post(self, request, repo_id, format=None):
    emails = request.POST.getlist('emails', '')
    s_type = request.POST.get('s_type', '')
    path = request.POST.get('path', '')
    perm = request.POST.get('perm', 'r')
    file_or_dir = os.path.basename(path.rstrip('/'))
    username = request.user.username

    for email in [e.strip() for e in emails if e.strip()]:
        if not is_registered_user(email):
            continue

        if s_type == 'f':
            pfds = PrivateFileDirShare.objects.add_read_only_priv_file_share(
                username, email, repo_id, path)
        elif s_type == 'd':
            pfds = PrivateFileDirShare.objects.add_private_dir_share(
                username, email, repo_id, path, perm)
        else:
            continue

        # send a signal when sharing file successful
        share_file_to_user_successful.send(sender=None, priv_share_obj=pfds)
    return HttpResponse(json.dumps({"message:share success"}), status=200, content_type=json_content_type)

curl命令的结果是这样,是怎么回事

阅读 4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题