GET to POST for v1/profiles endpoint (#523)

Changed GET to POST as a GET with a request body is not preferred.
This commit is contained in:
jenjac
2018-10-10 11:32:46 -05:00
committed by Victor Vrantchan
parent 3370b9cb11
commit 323c05b230
2 changed files with 3 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ func NewHTTPClient(instance, token string, logger log.Logger, opts ...httptransp
var getProfilesEndpoint endpoint.Endpoint
{
getProfilesEndpoint = httptransport.NewClient(
"GET",
"POST",
httputil.CopyURL(u, "/v1/profiles"),
httputil.EncodeRequestWithToken(token, httptransport.EncodeJSONRequest),
decodeGetProfilesResponse,

View File

@@ -22,11 +22,11 @@ func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoin
}
func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption) {
// GET /v1/profiles get a list of profiles managed by the server
// POST /v1/profiles get a list of profiles managed by the server
// PUT /v1/profiles create or replace a profile on the server
// DELETE /v1/profiles remove one or more profiles from the server
r.Methods("GET").Path("/v1/profiles").Handler(httptransport.NewServer(
r.Methods("POST").Path("/v1/profiles").Handler(httptransport.NewServer(
e.GetProfilesEndpoint,
decodeGetProfilesRequest,
httputil.EncodeJSONResponse,