dapengzhao
V2EX  ›  问与答

有人对 aiohttp 这个框架熟悉吗?用这个框架在上传头像上遇到了问题。

  •  
  •   dapengzhao · Nov 5, 2018 · 1616 views
    This topic created in 2835 days ago, the information mentioned may be changed or developed.

    elif request.content_type.startswith('application/x-www-form-urlencoded'): request.data = await request.post() print(request.data,type(request.data))

    <MultiDictProxy('icon': '1.png')> <class 'multidict._multidict.MultiDictProxy'> 得到这样一个对象,不知该如何处理。

    2 replies    2018-11-05 20:24:42 +08:00
    congeec
        1
    congeec  
       Nov 5, 2018 via iPhone
    去读 multidict 的文档啊
    dapengzhao
        2
    dapengzhao  
    OP
       Nov 5, 2018
    @congeec 大体看了一下这里的 1.png 是一个字符串,好像并没有把图片对象传上来。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5528 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:42 · PVG 09:42 · LAX 18:42 · JFK 21:42
    ♥ Do have faith in what you're doing.