在Delphi中修改Rest Server上的URL [英] Modifying URLs on a Rest Server in Delphi
问题描述
http://192.168.1.84:8080/datasnap/rest/TServerMethods1/GetListings
我得到的东西看起来更像是 http://192.168.1.84:8080/GetListings
有一个很好的做法吗?
命名约定是(Delphi XE3):
http://my.site.com/datasnap/rest/URIClassName/URIMethodName [/ inputParameter]
您可以轻松更改 datanap和rest部分的URL在TDSHTTPWebDispatcher组件属性中。您可以通过简单地更改类和方法的名称来更改URL的类名称和方法名称。但是,您仍然必须在URL中包含4个组件,例如:
http://my.site.com/api/v1/People/Listing
见:
http ://docwiki.embarcadero.com/RADStudio/XE3/en/REST#Customizing_the_URL_for_REST_requests
I've written a REST server in Delphi XE (using the wizard) and I want to change the URLs a bit so that instead of having http://192.168.1.84:8080/datasnap/rest/TServerMethods1/GetListings I get something that looks more like http://192.168.1.84:8080/GetListings
Is there a nice easy of doing this?
The naming convention is (Delphi XE3):
http://my.site.com/datasnap/rest/URIClassName/URIMethodName[/inputParameter]
You can easily change the "datasnap" and "rest" part of the URL in the TDSHTTPWebDispatcher component properties. You can change the Class Name and Method Name of the URL by simply changing the name of your class and method. However, you still have to have 4 components to the URL, so for example it could be:
http://my.site.com/api/v1/People/Listing
See here:
http://docwiki.embarcadero.com/RADStudio/XE3/en/REST#Customizing_the_URL_for_REST_requests
这篇关于在Delphi中修改Rest Server上的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!