permaculture playing cards*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 19556
    
  16

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting content-type in HTTPURLConnection ?
 
Similar Threads
sending PUT,DELETE requests to HttpServlet (urgent)
Some of you are experts this could be your next problem!
FileNotFoundException Response 500
DELETE http request in HttpURLConnection....
HTTPUrlConnection only works with Debugger-without I'm to fast??!!