uri

【Web Design The Missing Link】Designing Representations

只谈情不闲聊 提交于 2020-01-22 12:31:45
目录 使用JSON 让JSON简洁化 包含链接 为什么这样更好? 当有链接时URI模板还有用吗? 类比万维网 包含链接,步骤二 注意事项 在资源中如何表示链接? 谁使用链接? 更多 API设计的许多讨论都是从如何设计URL开始的。在像REST这样的面向数据的模型中,我们认为最好从表示形式(Representations)设计开始。 我们将在“Designing URL”一节中讨论URL设计。 表现形式(representation)作为技术术语,其含义可描述为: 客户端从服务器检索Web资源或从客户端发送到服务器时返回的数据 在REST模型中,Web资源不具有直观的基础状态,「 在客户端和服务器之间所流动着的 」,便是对那种状态的一种描述。用户可以查看一个资源不同形式的"表现形式"(representation),而这被称为“MEDIA-TYPE”。原则上,用于表示特定资源的所有媒体类型都可以以不同的格式来编码相同的信息。 使用JSON Web API中资源表示的主要媒体类型是JSON(JavaScript Object Notation)。 JSON成功的主要原因可能是易于理解,并且易于映射到JavaScript和其他流行编程语言(Python,Ruby,Java等)的数据结构中。现在,您应该使用JSON,因为它已成为Web API事实上的标准。 虽然JSON很好而且很受欢迎

MARKLOGIC: Is it possible to use more than 1 columns from a CSV file when generating URI ID during data ingestion in MarkLogic?

独自空忆成欢 提交于 2020-01-21 19:16:22
问题 I am quite new to MarkLogic and I am not sure how to best deal with the challenge I have right now. I have a CSV file exported from a table that will be ingested to MarkLogic database. Now the source table uses 4 columns as its unique primary key combination. In MarkLogic, by default, only one column from CSV file can be used as the URI ID. My question is, is it possible to use more than 1 columns from a CSV file as the URI ID during data ingestion in MarkLogic? If yes, is this feature or

MARKLOGIC: Is it possible to use more than 1 columns from a CSV file when generating URI ID during data ingestion in MarkLogic?

江枫思渺然 提交于 2020-01-21 19:13:02
问题 I am quite new to MarkLogic and I am not sure how to best deal with the challenge I have right now. I have a CSV file exported from a table that will be ingested to MarkLogic database. Now the source table uses 4 columns as its unique primary key combination. In MarkLogic, by default, only one column from CSV file can be used as the URI ID. My question is, is it possible to use more than 1 columns from a CSV file as the URI ID during data ingestion in MarkLogic? If yes, is this feature or

Base Uri without a trailing slash

不问归期 提交于 2020-01-21 10:47:31
问题 If I create a Uri using the UriBuilder like this: var rootUrl = new UriBuilder("http", "example.com", 50000).Uri; then the AbsoluteUri of rootUrl always contain a trailing slash like this: http://example.com:50000/ What I would like, is to create a Uri object without the trailing slash, but it seems impossible. My workaround is to store it as a string instead, and do something ugly like this: var rootUrl = new UriBuilder("http", "example.com", 50000).Uri.ToString().TrimEnd('/'); I have heard

Base Uri without a trailing slash

做~自己de王妃 提交于 2020-01-21 10:46:09
问题 If I create a Uri using the UriBuilder like this: var rootUrl = new UriBuilder("http", "example.com", 50000).Uri; then the AbsoluteUri of rootUrl always contain a trailing slash like this: http://example.com:50000/ What I would like, is to create a Uri object without the trailing slash, but it seems impossible. My workaround is to store it as a string instead, and do something ugly like this: var rootUrl = new UriBuilder("http", "example.com", 50000).Uri.ToString().TrimEnd('/'); I have heard

Creating custom URI scheme using URI class

你说的曾经没有我的故事 提交于 2020-01-21 09:41:13
问题 I need to create a custom URI scheme for my project. i.e urn:myprotocol:{p1}:{p2}:{p3}:{p4} - opaque representation myprotocol://{p1}/{p2}/{p3}/{p4} - hierarchical representation. How can I add my scheme to Java URI class? Or, how can I make Java URI to understand my scheme, so I could use it in my code? Concrete examples are welcome. Thanks. 回答1: Are you sure you need to create a new URI scheme? It's considered bad practice to create implementation-specific schemes. See: http://infomesh.net

web.xml配制文件详解

邮差的信 提交于 2020-01-21 09:37:41
====> 我的新浪小铺 每一个站的WEB-INF下都有一个web.xml的设定文件,它提供了我们站台的配置设定. web.xml定义: .站台的名称和说明 .针对环境参数(Context)做初始化 工作 .Servlet的名称和映射 .Session的设定 .Tag library的对映 .JSP网页设定 .Mime Type处理 .错误处理 .利用JDNI取得站台资源 要了解web.xml的设定值,必须了解它的schema,从web.xml中知道它的schema是由Sum Microsystems公司定制的,如果你想更为详细的了解它, 可以到 http://java.sun.com/xml/ns/j2ee/web-mapp_2_4.xsd 网页,那里有更为详细的介绍。这里我介绍我们平常见得最都的. <?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns=" http://java.sun.com/xml/ns/j2ee " xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance " xsi:schemaLocation=" http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd " version="2.4"> <web

web.xml配置文件详解

空扰寡人 提交于 2020-01-21 09:37:29
web .xml元素介绍 每一个站的 WEB -INF下都有一个 web .xml的设定文件,它提供了我们站台的配置设定. web .xml定义: .站台的名称和说明 .针对环境参数(Context)做初始化工作 .Servlet的名称和映射 .Session的设定 .Tag library的对映 .JSP网页设定 .Mime Type处理 .错误处理 .利用JDNI取得站台资源 要了解 web .xml的设定值,必须了解它的schema,从 web .xml中知道它的schema是由Sum Microsystems公司定制的,如果你想更为详细的了解它, 可以到http://java.sun.com/xml/ns/j2ee/ web -mapp_2_4.xsd网页,那里有更为详细的介绍。这里我介绍我们平常见得最都的. <?xml version="1.0" encoding="ISO-8859-1"?> < web -app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/ web -app_2_4.xsd" version="2.4"> <

RESTful 架构详解

痴心易碎 提交于 2020-01-21 04:36:16
RESTful 架构详解 分类 编程技术 1. 什么是REST REST全称是Representational State Transfer,中文意思是表述(编者注:通常译为表征)性状态转移。 它首次出现在2000年Roy Fielding的博士论文中,Roy Fielding是HTTP规范的主要编写者之一。 他在论文中提到:"我这篇文章的写作目的,就是想在符合架构原理的前提下,理解和评估以网络为基础的应用软件的架构设计,得到一个功能强、性能好、适宜通信的架构。REST指的是一组架构约束条件和原则。" 如果一个架构符合REST的约束条件和原则,我们就称它为RESTful架构。 REST本身并没有创造新的技术、组件或服务,而隐藏在RESTful背后的理念就是使用Web的现有特征和能力, 更好地使用现有Web标准中的一些准则和约束。虽然REST本身受Web技术的影响很深, 但是理论上REST架构风格并不是绑定在HTTP上,只不过目前HTTP是唯一与REST相关的实例。 所以我们这里描述的REST也是通过HTTP实现的REST。 2. 理解RESTful 要理解RESTful架构,需要理解Representational State Transfer这个词组到底是什么意思,它的每一个词都有些什么涵义。 下面我们结合REST原则,围绕资源展开讨论,从资源的定义、获取、表述、关联

RESTful 架构详解

独自空忆成欢 提交于 2020-01-21 04:33:35
1. 什么是REST REST全称是Representational State Transfer,中文意思是表述(编者注:通常译为表征)性状态转移。 它首次出现在2000年Roy Fielding的博士论文中,Roy Fielding是HTTP规范的主要编写者之一。 他在论文中提到:"我这篇文章的写作目的,就是想在符合架构原理的前提下,理解和评估以网络为基础的应用软件的架构设计,得到一个功能强、性能好、适宜通信的架构。REST指的是一组架构约束条件和原则。" 如果一个架构符合REST的约束条件和原则,我们就称它为RESTful架构。 REST本身并没有创造新的技术、组件或服务,而隐藏在RESTful背后的理念就是使用Web的现有特征和能力, 更好地使用现有Web标准中的一些准则和约束。虽然REST本身受Web技术的影响很深, 但是理论上REST架构风格并不是绑定在HTTP上,只不过目前HTTP是唯一与REST相关的实例。 所以我们这里描述的REST也是通过HTTP实现的REST。 2. 理解RESTful 要理解RESTful架构,需要理解Representational State Transfer这个词组到底是什么意思,它的每一个词都有些什么涵义。 下面我们结合REST原则,围绕资源展开讨论,从资源的定义、获取、表述、关联、状态变迁等角度,列举一些关键概念并加以解释。