aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to change content type in XMLHttpRequest? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to change content type in XMLHttpRequest?" Watch "How to change content type in XMLHttpRequest?" New topic
Author

How to change content type in XMLHttpRequest?

Palani Kumar
Greenhorn

Joined: May 28, 2008
Posts: 13
I want to change content type "text/html" to "text/xml". How to do this? XMLHttpRequest.setRequestHeader( "Content-Type", "text/xml;charset=UTF-8"); is not working...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Not working in what way? What effect did you expect it to have? What happened instead?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Are you trying to set the request or the response header?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Palani Kumar
Greenhorn

Joined: May 28, 2008
Posts: 13
Actually here i'm passing xml as string. If I pass as xml it works fine. It does not working if I pass xml as string i'm receiving error
Problem retrieving data
. What should I change to work fine. Here is my code.


Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

This question seems to be about Javascript. Let's move it to a more suitable forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to change content type in XMLHttpRequest?