码迷,mamicode.com
首页 > 其他好文 > 详细

A crawler that sent a DELETErequest to every resource it encountered

时间:2016-08-14 19:10:28      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

RESTful Web APIs_2013

The crawler simulates a very curious but not very picky human. Give it a URL to startwith, and it will fetch a representation. Then it will follow all the links it can find to getmore representations. It will do this recursively, until there are no more representations to be had.The Mapmaker client from earlier in this chapter is a kind of crawler for Maze+XML documents. The spiders used by search engines are crawlers for HTML documents.It‘s quite difficult to write a crawler for an API that doesn‘t use hypermedia. But you can write a crawler for a hypermedia-based API without even understanding that API‘s linkrelations.Generally speaking, a crawler will only trigger state transitions that are safe. Otherwise,there‘s  no  telling  what  will  happen  to  resource  state.  A  crawler  that  sent  a  DELETE request to every resource it encountered, just to see what happened, would be a terrible client.

A crawler that sent a DELETErequest to every resource it encountered

标签:

原文地址:http://www.cnblogs.com/yuanjiangw/p/5770714.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!