onshape-public / onshape-clients

All Onshape clients for interacting with the Onshape API.
MIT License
34 stars 29 forks source link

Assembly.get_features returns 406 #53

Closed francesco-romano closed 2 years ago

francesco-romano commented 4 years ago

When calling the Python Assembly.get_features function, the server returns

HTTP response body: {
  "moreInfoUrl" : "",
  "message" : "Request not acceptable.",
  "status" : 406,
  "code" : 0
}

Comparing the API Explorer and the Python implementation I found a different definition for the header accept key: The API explorer gives: application/vnd.onshape.v1+json while Python: application/vnd.onshape.v2+json;charset=UTF-8;qs=0.2 Note that v1 vs v2. Changing the Python to match the API explorer I can at least make the call (still need to _preload_content=False to avoid exceptions while parsing

francesco-romano commented 2 years ago

I think in the meantime the server has been updated. No need for this change anymore. The server accepts the v2 version