java - Google Drive API responds with 416 HTTP code -
for reason working code stopped working , server started respond 416.
here logs of http client during failing interaction:
-------------- request -------------- https://www.googleapis.com/drive/v3/files/0b02nopv3sqovovnkadiwtez3mhd?alt=media accept-encoding: gzip authorization: <not logged> range: bytes=0-33554431 user-agent: app google-api-java-client google-http-java-client/1.22.0 (gzip) -------------- response -------------- http/1.1 416 requested range not satisfiable alt-svc: quic=":443"; ma=2592000; v="39,38,37,35" server: uploadserver cache-control: private, max-age=0 content-range: bytes */0 x-guploader-uploadid: aenb2uqbx9b09lnr8tg761gdoz3dkhhsno_ozhh1lku6b2908v17rnbgqzsnw4zvtjbrdftvpwwiqzgdtsrto6zwn7yw9nxf6d vary: x-origin vary: origin expires: mon, 11 sep 2017 15:23:20 gmt content-length: 225 date: mon, 11 sep 2017 15:23:20 gmt content-type: application/json; charset=utf-8
i trying download file around 200000 bytes, thought meaning of "chuck size" changed somewhere, not give 33554431 bytes of 282177 byte file. tried changing smaller value, no success.
drive.files.get = drive.files().get(file.getid()) mediahttpdownloader downloader = get.getmediahttpdownloader() downloader.directdownloadenabled = false localfile.newoutputstream() get.executemediaanddownloadto(stream)
direct download not work either, downloads "0" bytes. know how overcome issue?
416 range not satisfiable error means server not able serve requested ranges. reason document doesn't contain such ranges, or range header value, though syntactically correct, doesn't make sense.
one of resolutions may provide forum to:
add "accept-ranges: none" our response headers.
Comments
Post a Comment