Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

General discussion
  1. OpenProject
  2. Forums
  3. General discussion
  4. api delete: 406 Missing content-type header, but header is present

api delete: 406 Missing content-type header, but header is present

Added by Julia Braun over 2 years ago

Hello everyone,

I want to delete projects via the API project endpoint and have been struggling with the following problem: 

1. I send a DELETE request to the project end point api/v3/projects/<id>, where <id> is the id of the project I want to delete and that I queried before with an empty GET request to the end point api/v3/projects/. 
2. I receive the response [406], with the content 'Missing content-type header'. I however specified the header. 

My code looks like this:

import requests

delete_url = 'http://apikey:<apikey>@mysite.com/api/v3/projects/<id>'


headers = {'Content-type': 'application/json'}
response = requests.delete(delete_url, data={}, headers=headers, allow_redirects=True)

# this outputs: <Response [406]>
print(response)

response = response.content

# this outputs: b'Missing content-type header'
print(response)

It says that I am missing the content-type header but I specify it. The error [406] is not documented in https://www.openproject.org/docs/api/endpoints/projects/ 

Does anybody have any hint what's the problem?

Thank you and and a happy new year ! 
Julia


Loading...