Content-Length of Snapshot URL only 345 Byte

SOLVED
christiand
New here

Content-Length of Snapshot URL only 345 Byte

EDIT

My bad, I should have checked the raw content of my "downloaded" file. I'm getting a "400-Bad Request" response on the download. I'll investigate this a bit more.

 

**********

 

Hello everyone,

 

I'm not new to APIs but currently working on my first tool for the Meraki API. And I'm running into an issue not directly connected to the API but to the download URL provided after making the request.

 

The response header is giving me a "Content-Length" value of 345. The image itself is way larger though.

 

I tried the typical python code lines with 'requests.get()', 'requests.get(stream=True)', reading chunks, urllib2, ... but nothing really works. And I don't actually want to overwrite the header in any way.

 

Does anyone ran into this issue and found a way to fix it?

 

Thanks!

 

The response header I'm getting back:

 

{'Server': 'nginx', 'Date': 'Tue, 12 Oct 2021 20:04:59 GMT', 'Content-Type': 'application/vnd.apple.mpegurl', 'Content-Length': '345', 'Connection': 'keep-alive', 'X-Content-Type-Options': 'nosniff', 'Access-Control-Allow-Credentials': 'true'}

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PhilipDAth
Kind of a big deal

Re: Content-Length of Snapshot URL only 345 Byte

Remember, it's only a URL you are being given.  You have to download the URL to get the actual image.

 

Also note that you can't download the URL straight away.  You'll want to use a loop and attempt the download multiple times with a delay in between each attempt (like 20s).

View solution in original post

2 REPLIES 2
PhilipDAth
Kind of a big deal

Re: Content-Length of Snapshot URL only 345 Byte

Remember, it's only a URL you are being given.  You have to download the URL to get the actual image.

 

Also note that you can't download the URL straight away.  You'll want to use a loop and attempt the download multiple times with a delay in between each attempt (like 20s).

View solution in original post

christiand
New here

Re: Content-Length of Snapshot URL only 345 Byte

The delay was the perfect tip. It's working perfectly now. Thank you!

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.