tags:

views:

46

answers:

2

Hello everybody,

I'm I have one dilema. I have only the URL of the web page or the RESTful web service but I dont know if it is web page or RESTful web service. Is it possible to make distinction beween web page and RESTful web service at runtime?

Thank you!

A: 

A web page is a RESTful Web Service.

Most likely not unless the RESTful Service has some special http header to identify itself or uses some special mimetype that's not html.

BrennaSoft
A: 

Check the content-type header of the response. A web service should return an HTTP-compliant document that is not of the "text/html" variety. Usually you can expect XML or JSON, but a service could return an image, plain text or other data that doesn't comply to those formats.

Read RESTful Web Services for a more complete description.

David Lively