Natgho / HMS-Publishing-API

HMS Publishing API Python Client
3 stars 3 forks source link

CException 70001405 get no file from request #4

Open ssb22 opened 2 years ago

ssb22 commented 2 years ago

I've been using this to update my AppGallery app since 2020. Thanks. But just now it has stopped working as it seems Huawei has changed something.

In upload_app where it says first_phase = requests.post(self.upload_url, etc, Huawei is now returning HTTP status 200 (OK) but the body is: {'result': {'CException': {'errorCode': 70001405, 'errorDesc': 'get no file from request!'}, 'resultCode': '70001405'}} this then causes a Python exception when it tries to read first_phase.json()['result']['UploadFileRsp'] which does not exist.

It seems get_upload_url is still returning good data, so I guess something must have changed in the format accepted by the resulting uploadFile endpoint.

ssb22 commented 2 years ago

Figured it out. The file must now be called "file" instead of the original filename. I'll do a pull request.