Details
- 
        Type:Monitor 
- 
        Status: Closed
- 
            Priority: Major Major
- 
            Resolution: Done
- 
            Affects Version/s: None
- 
            Fix Version/s: 2021
- 
            Component/s: FIWARE-TECH-HELP
- 
                        HD-Enabler:Orion
Description
Created question in FIWARE Q/A platform on 20-12-2016 at 16:12
Please, ANSWER this question AT https://stackoverflow.com/questions/41245352/how-to-work-with-delete-request-and-x-auth-token
Question:
How to work with DELETE request and X-Auth-Token
Description:
I want DELETE operation be allowed only after authentication/authorization process. I tried to do a DELETE operation passing an X-Auth-Token, but I got this: The status of this operation is: 400 Some error occurred!
I did this with GET request, without problem, but it is not working for DELETE.
headers =
{'X-Auth-Token': token}s = Session()  
request = Request('DELETE', DELETE_URL + entity_id, headers=headers)
prepped = request.prepare()
del prepped.headers['Content-Length']
r = s.send(prepped)
Activity
| Field | Original Value | New Value | 
|---|---|---|
| Component/s | FIWARE-TECH-HELP [ 10278 ] | 
| Status | Open [ 1 ] | In Progress [ 3 ] | 
| Resolution | Done [ 10000 ] | |
| Status | In Progress [ 3 ] | Closed [ 6 ] | 
| Assignee | Fermín Galán [ fermin ] | 
| Summary | [fiware-stackoverflow] How to work with DELETE request and X-Auth-Token | FIWARE.Question.Tech.How to work with DELETE request and X-Auth-Token. | 
| HD-Enabler | Orion [ 10875 ] | |
| Description | Created question in FIWARE Q/A platform on 20-12-2016 at 16:12 {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/41245352/how-to-work-with-delete-request-and-x-auth-token +Question:+ How to work with DELETE request and X-Auth-Token +Description:+ I want DELETE operation be allowed only after authentication/authorization process. I tried to do a DELETE operation passing an X-Auth-Token, but I got this: The status of this operation is: 400 Some error occurred! {"error":"BadRequest","description":"Orion accepts no payload for GET/DELETE requests. HTTP header Content-Type is thus forbidden"} I did this with GET request, without problem, but it is not working for DELETE. headers = {'X-Auth-Token': token} s = Session() request = Request('DELETE', DELETE_URL + entity_id, headers=headers) prepped = request.prepare() del prepped.headers['Content-Length'] r = s.send(prepped) | Created question in FIWARE Q/A platform on 20-12-2016 at 16:12 {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/41245352/how-to-work-with-delete-request-and-x-auth-token +Question:+ How to work with DELETE request and X-Auth-Token +Description:+ I want DELETE operation be allowed only after authentication/authorization process. I tried to do a DELETE operation passing an X-Auth-Token, but I got this: The status of this operation is: 400 Some error occurred! {"error":"BadRequest","description":"Orion accepts no payload for GET/DELETE requests. HTTP header Content-Type is thus forbidden"} I did this with GET request, without problem, but it is not working for DELETE. headers = {'X-Auth-Token': token} s = Session() request = Request('DELETE', DELETE_URL + entity_id, headers=headers) prepped = request.prepare() del prepped.headers['Content-Length'] r = s.send(prepped) | 
| Fix Version/s | 2021 [ 12600 ] | 
| Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
|---|---|---|---|---|---|---|---|---|---|
| 
 | 2h 59m | 1 | Backlog Manager | 08/Jun/17 9:04 PM | |||||
| 
 | 2h 59m | 1 | Backlog Manager | 09/Jun/17 12:04 AM | 
 
	 
		                 
	 
	
2017-06-08 18:06|CREATED monitor | # answers= 2, accepted answer= True