CLI sends parameters in the query string for idempotent operations

Bug #1060079 reported by Gavin Panella
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Gavin Panella

Bug Description

However, the back-end only expects parameters in the query string for GET requests. The other supported HTTP methods - POST, PUT, DELETE - look for parameters in the request body. This bug causes PUT and DELETE requests from finding the parameters they expect.

There's nothing to prevent looking in the query string, or in both the query string and request body, but it just doesn't seem to be the way that Piston/Django/MAAS are wired. In part I blame the misleading convention that has arisen where parameters in the query string are referred to as "GET" parameters, and those in the body are "POST" parameters.

The simplest solution here seems to be to get the CLI to only send parameters in the query string for GET requests, and otherwise encode them in the message body.

Tags: api cli

Related branches

Gavin Panella (allenap)
Changed in maas:
status: Triaged → In Progress
assignee: nobody → Gavin Panella (allenap)
Revision history for this message
Diogo Matsubara (matsubara) wrote :

This might be the root cause for bug 1057854

Revision history for this message
Raphaël Badin (rvb) wrote :

I think you're right Diogo, the CLI can't really call properly any update() API method until this bug is fixed..

Raphaël Badin (rvb)
Changed in maas:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.