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

curl命令" title="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命令的结果是这样,是怎么回事

以上是 [已解决]curl命令运行结果如下,该如何修改,谢谢,命令和程序附在下面 的全部内容, 来源链接: utcz.com/a/161376.html

回到顶部