spartikus spartikus - 16 days ago 6
Java Question

How do I force Chrome Postman to return application/xml instead of application/octect-stream

I am using google chrome plugin Postman for testing some restful web services. Some of my webservices have a produces annotation that has several types defined. Each time I run one of my services though, it seems postman's results are determined to always return in octect-stream form. Is there a way to force postman (or potentially my service) to return application/xml results? I would prefer not to change the annotation but will if thats my only choice.

My service definition -

@GET
@Produces( { MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON,
"application/x-javascript", MediaType.APPLICATION_OCTET_STREAM } )
@Path( "/getCustomers/" )
public Response getCustomers


My postman call is just a GET call with no parameters on the header like this:

http://myserver:8080/test/getCustomers

Answer

Maybe your default response type is octect-stream

Use the below http headers in POSTMAN

Accept: application/xml

Do the server validations based on Accept headers.