You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-14Lines changed: 3 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,6 @@ The HTTP-RPC framework includes the following classes:
42
42
43
43
*`org.httprpc`
44
44
*`RequestMethod` - associates an HTTP verb with a service method
45
-
*`RequestParameter` - associates a custom request parameter name with a method argument
46
45
*`ResourcePath` - associates a resource path with a service method
47
46
*`WebServiceException` - thrown when a service operation returns an error
48
47
*`WebServiceProxy` - web service invocation proxy
@@ -72,7 +71,7 @@ These classes are discussed in more detail in the following sections.
72
71
## WebService
73
72
`WebService` is an abstract base class for web services. It extends the similarly abstract `HttpServlet` class provided by the servlet API.
74
73
75
-
Service operations are defined by adding public methods to a concrete service implementation. Methods are invoked by submitting an HTTP request for a path associated with a servlet instance. Arguments are provided either via the query string or in the request body, like an HTML form. `WebService` converts the request parameters to the expected argument types, invokes the method, and writes the return value to the output stream as [JSON](http://json.org).
74
+
Service operations are defined by adding public methods to a concrete service implementation. Methods are invoked by submitting an HTTP request for a path associated with a servlet instance. Arguments are provided either via the query string or in the request body, like an HTML form. `WebService` converts the request parameters to the expected argument types, invokes the method, and writes the return value to the output stream as [JSON](http://json.org). Service classes must be compiled with the `-parameters` flag so the names of their method parameters are available at runtime.
76
75
77
76
The `RequestMethod` annotation is used to associate a service method with an HTTP verb such as `GET` or `POST`. The optional `ResourcePath` annotation can be used to associate the method with a specific path relative to the servlet. If unspecified, the method is associated with the servlet itself. If no matching handler method is found for a given request, the default handler (e.g. `doGet()`) is called.
78
77
@@ -173,16 +172,6 @@ The methods could be invoked using this HTML form:
173
172
174
173
If no method is found that matches the provided arguments, an HTTP 405 response is returned.
175
174
176
-
#### Parameter Names
177
-
In general, service classes should be compiled with the `-parameters` flag so the names of their method parameters are available at runtime. However, the `RequestParameter` annotation can be used to customize the name of the parameter associated with a particular argument. For example:
Path variables may be specified by a "?" character in the resource path. For example:
188
177
@@ -1097,9 +1086,9 @@ public static <T> T adapt(URL baseURL, Class<T> type, Map<String, ?> headers) {
1097
1086
1098
1087
Both versions take a base URL and an interfacetype as arguments and return an instance of the given type that can be used to invoke service operations. The second version also accepts a map of HTTP header values that will be submitted with every service request.
1099
1088
1100
-
The `RequestMethod` annotation is used to associate an HTTP verb with an interfacemethod. The optional `ResourcePath` annotation can be used to associate the method with a specific path relative to the base URL. If unspecified, the method is associated with the base URL itself.
1089
+
The `RequestMethod` annotation is used to associate an HTTP verb with an interfacemethod. The optional `ResourcePath` annotation can be used to associate the method with a specific path relative to the base URL. If unspecified, the method is associated with the base URL itself.
1101
1090
1102
-
In general, service adapters should be compiled with the `-parameters` flag so their method parameter names are available at runtime. However, the `RequestParameter` annotation can be used to associate a custom parameter name with a request argument.
1091
+
Service adapters must be compiled with the `-parameters` flag so their method parameter names are available at runtime.
1103
1092
1104
1093
`POST` requests are always submitted using the multi-part encoding. Values are returned as described for `WebServiceProxy` and adapted as described [earlier](#beanadapter) based on the method return type.
0 commit comments