I am using an endpoint similar to the below code
type TestService struct {
gorest.RestService `root:"/test/"`
testPost gorest.EndPoint `method:"POST" path:"/testPost/" postdata:"map[string]string"`
}
I get and handle the posted data, and want to return a payload to the calling client, i.e. success/error and a message.
I cannot make out from the documentation how to achieve this, appending the output
tag and returning anything from the function as per a GET end point fails with the following error;
Parameter list not matching. No matching Method found for EndPoint:[testPost],type:[POST] . Expecting: #func(serv DocumentService) TestPost(PostData map[string]string)# with no return parameters.
Is it possible to return a payload to the client? If not can I redirect to a different end point on success / failure?