File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Setting content-type in HTTPURLConnection ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Setting content-type in HTTPURLConnection ?" Watch "Setting content-type in HTTPURLConnection ?" New topic
Author

Setting content-type in HTTPURLConnection ?

Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Guys,

I was adding this method in my client code:



When i try to call the following method : it does retrieve "application/xml" What can be the possible reason for this or i am doing something wrong for setting the content type.



Any clues ?

Thanks,
Rahul

Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

connection.getContentType() returns the Content-Type as returned by the server.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: Setting content-type in HTTPURLConnection ?