1

I am using Jax-RS and jersey to implement a web service, I can use the Response class to send an response code to the client:

Response.status(Status.MOVED_PERMANENTLY).build();

Or I can send Response content:

Response.ok("Respose").build();

Is there a way to send an arbitrary response for an arbitrary code?

Specifically I am trying to send the authorization code in a redirect for OAuth.

Usman Ismail
  • 17,999
  • 14
  • 83
  • 165

1 Answers1

3

Take a look at this JAX-RS — How to return JSON and HTTP status code together?

Response.status(Response.Status.NOT_FOUND).entity("Hello World").build();

Community
  • 1
  • 1
lilalinux
  • 2,903
  • 3
  • 43
  • 53