0

I'm trying to upload some file to my file hosting service. I'm using aiohttp for it.

My server is quite limited in storage and I thought of chaining GET and POST requests, so I don't have to download the file to local. I used the example given in the documentation of aiohttp as a starting point to test my setup. Turns out i'm seeing some upload speed difference. Chained one is having reduced speed. Now i'm curious to know whether the setup is bad.

resp = await session.get('http://python.org')
await session.post('http://httpbin.org/post',
                   data=resp.content)

This is the example given in documentation and i'm using this, but i'm uploading files of greater size (like GB's)

1 Answers1

0

There is nothing inherently wrong with calling a GET then taking data returned from that GET and using it to call a POST. This is kinda the idea behind RESTful apis.

Now calling a GET and it returns a lot of data and then to turn around and send all that data to a POST where the POST is only looking for a certain part of that data would at worst be a waste of bandwidth and resources. But nothing harmful should come from it.

TeddyBearSuicide
  • 1,377
  • 1
  • 6
  • 11