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

DELETE verbs or urlencoded VERBS throws exception #13

Closed cyrillef closed 7 years ago

cyrillef commented 7 years ago

if you use ModelDerivative.deleteManifest (content.urn, forgeToken.RW, forgeToken.RW.getCredentials ()) or ObjectsApi.deleteObject (bucket, desc.objectKey, forgeToken.RW, forgeToken.RW.getCredentials ())

you get an exception wth the following message Error:TypeError: requestParams.form is not a function

https://github.com/Autodesk-Forge/forge-api-nodejs-client/blob/master/src/ApiClient.js#L342 < requestParams.form(this.normalizeParams(formParams)); should be

requestParams.form =this.normalizeParams(formParams);

adamenagy commented 7 years ago

In the "forge-apis/src/api/DerivativesApi.js" file's deleteManifest() function, replacing var contentTypes = ['application/x-www-form-urlencoded']; with var contentTypes = []; solved the problem.
The Model Derivative API's DELETE manifest endpoint is too sensitive anyway, and would fail if you added any Content-Type header values to the request - see DERI-3560.

gregra81 commented 7 years ago

@cyrillef, @adamenagy - Thank you for the heads up, we'll apply a fix in the next few days

zivSher commented 7 years ago

Fixed.