简体   繁体   中英

Using RESTful Services

This is a really simple question, I am just a beginner in RESTful api.

I have an ASP.NET MVC website which calls a RESTful api (ASP.NET WebApiController) that contains CRUD commands on some objects. Note that the RESTful api is still in development by another programmer and the objects/methods could change.

Up until now I was using regular WebServices which generated interfaces and objects according to the WebService's api. so each time something changed I would simply update the service reference. I can't use them now since I don't want the WebServices to be bound to my website.

My question is : is it ok to sent to the RESTful api hard-coded json objects (Example - for an animal class which has name and type I will create a json object {name:"lucky",type:"dog"})?

What if the objects/Methods change? (Like if the animal's name property will be called Name). How am I supposed to know this without an interface specifing the api?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM