Setting default Content Output Type Header in Axis2

Drew

Is there a way to set the default output type header in AXIS2 say for example to use "Content: application/json" even if the request does not have a content type header sent to the service?

Colinr

You could also use a content-type property mediator in each sequence, which can assign the content type. Here is an example:

<property name="ContentType" value="text/xml" scope="axis2"/>

Here is documentation on the Axis2 properties [1]. If you wish this to be applied by default, it would depend on what product you're using. With the api manager, you may edit the velocity-template.xml which is located in [apim home]/repository/resources/api-templates/. Any changes to this template file will affect all APIs as they are created or republished.

[1] https://docs.wso2.com/display/ESB481/Generic+Properties

Cheers, Colin

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Dompdf default page header content overlap

From Dev

NSIS inetc::put, cannot upload file: "Try setting the Content-type header."

From Dev

Content-Type setting for .MTS files

From Dev

PHP Default content type?

From Dev

WOFF2 - HTTP Content-Type response header suggestion

From Dev

Setting content-type header with restify results in application/octet-stream

From Dev

Setting request header content-type to json in Spring Framework resttemplate

From Dev

Setting response content type header in JSONP request?

From Dev

Setting the 'charset' property on the Content-Type header in the golang HTTP FileServer

From Dev

Setting standard output stream to default in java

From Dev

JAX-RS: Consuming JSON POST data without setting Content-Type header to application/json

From Dev

Angular 2, Http and Not setting Content-Type "application/json"

From Dev

Setting Content Type in Java HttpServer response

From Dev

Using Exit in CodeIgniter output makes the content type header to text/html instead of the defined one

From Dev

Set default content type header of Spring RestTemplate

From Dev

jQuery: Content type header is not set

From Dev

Setting default Content Output Type Header in Axis2

From Dev

NSIS inetc::put, cannot upload file: "Try setting the Content-type header."

From Dev

Setting response content type header in JSONP request?

From Dev

Spray not setting Content-Type header for FormData

From Dev

Controller returning HttpResponseMessage not setting content type correctly

From Dev

node, express app returns text/javascript response header (Content-Type) in spite of setting application/javascript

From Dev

Angular 2, Http and Not setting Content-Type "application/json"

From Dev

Using Exit in CodeIgniter output makes the content type header to text/html instead of the defined one

From Dev

Setting default Post header image in Wordpress?

From Dev

Setting a default constructor for one type with multiple inheritance

From Dev

Nginx setting wrong content type

From Dev

Overriding the default Content-Type

From Dev

Set Content-Type header

Related Related

  1. 1

    Dompdf default page header content overlap

  2. 2

    NSIS inetc::put, cannot upload file: "Try setting the Content-type header."

  3. 3

    Content-Type setting for .MTS files

  4. 4

    PHP Default content type?

  5. 5

    WOFF2 - HTTP Content-Type response header suggestion

  6. 6

    Setting content-type header with restify results in application/octet-stream

  7. 7

    Setting request header content-type to json in Spring Framework resttemplate

  8. 8

    Setting response content type header in JSONP request?

  9. 9

    Setting the 'charset' property on the Content-Type header in the golang HTTP FileServer

  10. 10

    Setting standard output stream to default in java

  11. 11

    JAX-RS: Consuming JSON POST data without setting Content-Type header to application/json

  12. 12

    Angular 2, Http and Not setting Content-Type "application/json"

  13. 13

    Setting Content Type in Java HttpServer response

  14. 14

    Using Exit in CodeIgniter output makes the content type header to text/html instead of the defined one

  15. 15

    Set default content type header of Spring RestTemplate

  16. 16

    jQuery: Content type header is not set

  17. 17

    Setting default Content Output Type Header in Axis2

  18. 18

    NSIS inetc::put, cannot upload file: "Try setting the Content-type header."

  19. 19

    Setting response content type header in JSONP request?

  20. 20

    Spray not setting Content-Type header for FormData

  21. 21

    Controller returning HttpResponseMessage not setting content type correctly

  22. 22

    node, express app returns text/javascript response header (Content-Type) in spite of setting application/javascript

  23. 23

    Angular 2, Http and Not setting Content-Type "application/json"

  24. 24

    Using Exit in CodeIgniter output makes the content type header to text/html instead of the defined one

  25. 25

    Setting default Post header image in Wordpress?

  26. 26

    Setting a default constructor for one type with multiple inheritance

  27. 27

    Nginx setting wrong content type

  28. 28

    Overriding the default Content-Type

  29. 29

    Set Content-Type header

HotTag

Archive