google cloud: downloading as an CSV

前端 未结 1 1541
闹比i
闹比i 2021-01-27 16:04

I have a download button that should return a users CSV. The code for it below:

class StartCSVHandler(ThreeScaleResourceHandler):
    \"\"\" Starts generating a         


        
1条回答
  •  一向
    一向 (楼主)
    2021-01-27 16:26

    firstly, the end point that this generates is '/api/v1/users/me/data/csv' and when visiting it, i receive the following error: {"error": {"title": "Unauthorized", "status": 401, "message": "You are not authorized to perform that action. Please use the api_key parameter with your registered key."}}

    Which handler in your code snippet handles /api/v1/users/me/data/csv? Is it StartCSVHandler? Are you sure it isn't being thrown because of this line? self.abort(401, detail=ERROR_NOT_AUTHORIZED)

    Secondly, the link it provides for the user to save cannot be found: http://localhost:8080/data?key=encoded_gs_file:cHJvamVjdC1ub2FoLWJhY2t1cHMvYWdoa1pYWi1UbTl1WlhJVkN4SUlUbTloYUZWelpYSVlnSUNBZ0lDQWdBb00vMTU4MTAxODk3My4wODgyODEvTXktU3BvdHRpbmdzLmNzdg==

    In what way? like you are trying to find the file on your machine or this link is throwing a 404?

    On your localhost, encoded_gs_file files can be found here: http://localhost:8000/blobstore

    If it's a 404, then what does your handler for /data do? It doesnt look like it's in your code snippet

    0 讨论(0)
提交回复
热议问题