Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #541 from idelpivnitskiy/AGPUSH-1376
Browse files Browse the repository at this point in the history
Change REST endpoints response type from "text/plain" to "application/json" with empty JSON body
  • Loading branch information
matzew committed May 5, 2015
2 parents 02b9630 + 76cd6da commit f8500ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public Response unregisterInstallations(
@POST
@Path("/importer")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
public Response importDevice(
@MultipartForm
ImporterForm form,
Expand Down Expand Up @@ -244,8 +245,7 @@ public Response importDevice(
clientInstallationService.addInstallations(variant, devices);

// return directly, the above is async and may take a bit :-)
return Response.status(Status.OK)
.entity("Job submitted for processing").build();
return Response.ok("{}").build();
}

private ResponseBuilder appendPreflightResponseHeaders(HttpHeaders headers, ResponseBuilder response) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class PushNotificationSenderEndpoint {
*/
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
@Produces(MediaType.APPLICATION_JSON)
public Response send(final UnifiedPushMessage message, @Context HttpServletRequest request) {

final PushApplication pushApplication = loadPushApplicationWhenAuthorized(request);
Expand All @@ -126,8 +126,7 @@ public Response send(final UnifiedPushMessage message, @Context HttpServletReque
logger.fine("Message sent by: '" + message.getClientIdentifier() + "'");
logger.info("Message submitted to PushNetworks for further processing");

return Response.status(Status.ACCEPTED)
.entity("Job submitted").build();
return Response.status(Status.ACCEPTED).entity("{}").build();
}

/**
Expand Down

0 comments on commit f8500ee

Please sign in to comment.