Autodesk-Forge / forge-api-nodejs-client

Forge Node.js SDK: Provides Node.js SDK to help you easily integrate Forge REST APIs into the application
Apache License 2.0
124 stars 86 forks source link

getObject and arraybuffer #101

Closed softremake closed 1 year ago

softremake commented 1 year ago

getting wrong results (bigger data size) while using getObject for pdfs. it works properly only with 'arraybuffer' here:

https://github.com/Autodesk-Forge/forge-api-nodejs-client/blob/48e79706b659552f75c8099c5e2131b68153df81/src/api/ObjectsApi.js#L375

            return (this.apiClient.callApi(
                '/oss/v2/buckets/{bucketKey}/objects/{objectKey}', 'GET',
                pathParams, queryParams, headerParams, formParams, postBody,
                contentTypes, accepts, returnType, oauth2client, credentials, 'arraybuffer'
            ));

can you please add responseType parameter of getObject and pass it down to callApi? it's at https://github.com/Autodesk-Forge/forge-api-nodejs-client/blob/48e79706b659552f75c8099c5e2131b68153df81/src/api/ObjectsApi.js#L347

I think it's similar to this fix: https://github.com/Autodesk-Forge/forge-api-nodejs-client/pull/99/commits/1fd286b0b25103f8f96f28bdcb6347484b903079