문제

i'm using apache HttpClient's GetMethod to get the contents in URL.That url contains nothing but 2 directories under it. My requirement is to read those directory name and displaying it.

I'm getting html source of that page as response, something like this

< ul>
< li >< a href="libraries/" >libraries /< /a>< /li>
< li >< a href="services/">services/< /li>
< /ul>

I feel, the response in the XML format or Json will be easy to use. Is there anyway to get the response in json/xml format?

I tried changing the content-type that didnt help

도움이 되었습니까?

해결책

The format of the response is the responsibility of the server not the client.

The client can only state in what format he would like the response and if the server supports it the client will get it in the wanted format.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top