This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 19651
    
  18

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
DELETE http request in HttpURLConnection....
Some of you are experts this could be your next problem!
FileNotFoundException Response 500
HTTPUrlConnection only works with Debugger-without I'm to fast??!!
sending PUT,DELETE requests to HttpServlet (urgent)