REST Datasnap覆盖URI映射 [英] REST Datasnap override URI mapping

查看:94
本文介绍了REST Datasnap覆盖URI映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用delphi XE2中的REST数据快照编写了一个小型REST服务器。
HTTP方法(POST,PUT等)与delphi中定义的函数之间存在默认映射,这是由delphi组件完成的。

I wrote a small REST server with the REST datasnap in delphi XE2. There is a default mapping between HTTP methods (POST, PUT etc.) and the functions defined in delp this is done by a delphi component.

< href = http://docwiki.embarcadero.com/RADStudio/zh-CN/REST#URI_Mapping rel = nofollow>此Wiki条目描述了URI映射,但也请注意,默认映射可以被

This wiki entry describes the URI mapping but also notes that the default mapping can be override by the programmer.


可以覆盖映射模式。用户可以根据类名称和方法名称参数覆盖每种类型的映射。

The mapping pattern can be overridden. The user can override the mapping for each type based on class name and method name parameters.

但是我没有找到任何解释覆盖映射。

But I didn't find any explanation how to override the mapping.

如何更改默认映射?

推荐答案

TDSHTTPService组件具有事件,您可以在其中为每种类型指定映射。这些事件称为RESTMethodNameMapDELETE,RESTMethodNameMapGET,RESTMethodNameMapPOST和RESTMethodNameMapPUT。

The TDSHTTPService component has events where you can specify the mapping for each type. These events are called RESTMethodNameMapDELETE, RESTMethodNameMapGET, RESTMethodNameMapPOST and RESTMethodNameMapPUT.

这在关于REST的白皮书,其中对REST和Datasnap进行了很多解释。

This is also explained in the white paper on REST by Marco Cantù, which explains a lot about REST and Datasnap.

这篇关于REST Datasnap覆盖URI映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆