question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't request delete operation from API

See original GitHub issue

When I try to request the delete operation fon an instance I got a stack trace from django (I’m on version 1.7.6b).

That’s the curl I try to execute :

curl -X POST "https://[...]/api/service_catalog/instance/[...]/operation/[...]/request/" -d '{ "fill_in_survey": { } }' -H 'Content-Type: application/json' -H "accept: application/json" -H "authorization: Bearer [...]"

And that’s the django stack trace :

[...]
  File "/app/service_catalog/models/request.py", line 62, in full_survey
    return {k: v for k, v in {**self.fill_in_survey, **self.admin_fill_in_survey}.items() if v is not None}

Exception Type: TypeError at /api/service_catalog/instance/[...]/operation/[...]/request/
Exception Value: 'str' object is not a mapping
Request information:
USER: admin

GET: No GET data
POST: No POST data
FILES: No FILES data
COOKIES: No cookie data
[...]

Please note that deleting from UI works as expected.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
mr-falkencommented, Oct 12, 2022

Hi @EliasBoulharts, it works like a charm, thanks for helping! 😃

0reactions
EliasBoulhartscommented, Oct 12, 2022

Fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

rest - Status code when deleting a resource using HTTP ...
The DELETE method is idempotent. This implies that the server must return response code 200 (OK) even if the server deleted the resource...
Read more >
Message "DELETE operations cannot have a requestBody ...
The API I was working indeed is a DELETE method having a request payload. So the error message is correct. However, several servers...
Read more >
Unable to delete API Management Resource - Microsoft Q&A
I'd like to delete it but Azure won't allow me to do so since the resource is considered to be 'transitioning' between states....
Read more >
Delete API | Elasticsearch Guide [8.5] | Elastic
You use DELETE to remove a document from an index. You must specify the index name and document ID. You cannot send deletion...
Read more >
DELETE - HTTP - MDN Web Docs
The HTTP DELETE request method deletes the specified resource.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found