You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
145439_request.url=self._client.format_url(_request.url)
... ... ...
145448response=pipeline_response.http_response145449145450ifresponse.status_codenotin [204, 404, 412]:
145451if_stream:
145452response.read() # Load the body in memory and close the socket145453map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore145454raiseHttpResponseError(response=response)
... ... ...
Temporary Workaround
As a hacky workaround, forcing the Content-Type header prior to the request within _operations.py with the following to force the Content-Type HTTP Header allows the API call to successfully process.
... ... ...
145439_request.url=self._client.format_url(_request.url)
print('Request: ', _request) # <- optional print for visibilityprint('Current Headers: ', _request.headers) # <- optional print for visibility_request.headers['Content-Type'] ='application/json; charset=utf-8'# <- Update HTTP header to force Content-Typeprint('Forced Content-Type addition headers:', _request.headers) # <- optional print updated headers145441_stream=False145442pipeline_response: PipelineResponse= (
145443self._client._pipeline.run( # pylint: disable=protected-acces144581 145444_request, stream=_stream, **kwargs145445 )
145446 )
145447145448response=pipeline_response.http_responseprint('Server Response:', response) # <- optional print for visibility of server response145450ifresponse.status_codenotin [204, 404, 412]:
145451if_stream:
145452response.read() # Load the body in memory and close the socket145453map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore145454raiseHttpResponseError(response=response)
... ... ...
Content-Type is defined in multiple places throughout the _operations.py file but not the delete projects function; it's likely better defined elsewhere.
The text was updated successfully, but these errors were encountered:
Using the example python for the Delete an Existing Project API call results in a
415 Unsupported Media Type
error(https://docs.digitalocean.com/reference/api/api-reference/#operation/projects_delete) e.g.:
As shown in the following error output:
In file _operations.py, the project DELETE functionality is outlined, with the request sent and response handled at
(https://raw.githubusercontent.com/digitalocean/pydo/refs/heads/main/src/pydo/operations/_operations.py):
Temporary Workaround
As a hacky workaround, forcing the Content-Type header prior to the request within _operations.py with the following to force the Content-Type HTTP Header allows the API call to successfully process.
204 is returned confirming successful deletion:
Content-Type is defined in multiple places throughout the _operations.py file but not the delete projects function; it's likely better defined elsewhere.
The text was updated successfully, but these errors were encountered: