[ https://issues.apache.org/jira/browse/MESOS-3920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15008852#comment-15008852 ]
Jan-Philip Gehrcke edited comment on MESOS-3920 at 11/17/15 3:44 PM: --------------------------------------------------------------------- A JSON object should really only be sent via the body, with the {{Content-Type}} header field set to {{application/json}}. {quote} It is weird to mix query parameters (slaveID, resources) with JSON-encoded values {quote} As long as the JSON object is sent with the body (and the body is valid JSON, and application/json is used as content type), query parameters can make sense. For example, a query parameter could be used for modifying the operation when the HTTP method alone (such as POST) is not specific enough. In that case there would be a clean separation between *payload* (body) and *method/operation*. An example for fine-adjusting the mode of operation would be a {{force=true}} query parameter for overriding certain sanity checks. was (Author: jgehrcke): A JSON object should really only be sent via the body, with the {{Content-Type}} header field set to {{application/json}}. {quote} It is weird to mix query parameters (slaveID, resources) with JSON-encoded values {quote} As long as the JSON object is sent with the body (and the body is valid JSON, and application/json is used as content type), query parameters can make sense. For example, a query parameter could be used for modifying the operation when the HTTP method alone (such as POST) is not specific enough. In that case there would be a clean separation between *payload* (body) and *method/operation*. An example for a fine-adjusting the mode of operation would be a {{force=true}} query parameter for overriding certain sanity checks. > Considering changing /reserve, /unreserve endpoint syntax > --------------------------------------------------------- > > Key: MESOS-3920 > URL: https://issues.apache.org/jira/browse/MESOS-3920 > Project: Mesos > Issue Type: Bug > Reporter: Neil Conway > Priority: Minor > Labels: http, mesosphere, reservations > > Right now, the "reserve" and "unreserve" endpoints work as follows: > 1. slaveID is sent as a separate query parameter > 2. the resources to reserve are sent as the "reserve" query parameter, where > the value is encoded in JSON > This is weird, for two reasons: > 1. It is more typical for POST to send the content of the new document in the > request body, not as parameters to the query string (e.g., > https://stackoverflow.com/questions/14551194/how-are-parameters-sent-in-an-http-post-request) > 2. It is weird to mix query parameters (slaveID, resources) with JSON-encoded > values. Why not just post a single JSON document with all the information > required for a dynamic reservation? > Obviously, there are some backward compatibility concerns if we want to > change this. -- This message was sent by Atlassian JIRA (v6.3.4#6332)