Alanxtl commented on code in PR #1109: URL: https://github.com/apache/dubbo-go-samples/pull/1109#discussion_r3620350357
########## rpc/rest/README.md: ########## @@ -0,0 +1,76 @@ +# Dubbo-Go REST sample + +This sample validates the Dubbo-Go REST protocol with direct URL, interface-level registry, and application-level service discovery. It uses an explicit REST mapping for path, query, header, and body arguments. + +## Run + +Start the provider with the default Nacos application-level service discovery mode: + +```bash +go run ./rpc/rest/go-server/cmd +``` + +Run the Dubbo-Go REST consumer in another terminal: + +```bash +go run ./rpc/rest/go-client/cmd +``` + +Expected client output: + +```text +REST response: userID=101 name=dubbo-go traceID=trace-rest-basic message=body-from-dubbo-rest-client greeting="hello dubbo-go, userID=101, traceID=trace-rest-basic, message=body-from-dubbo-rest-client" +``` + +The same provider is also a normal HTTP endpoint: + +```bash +curl -s \ + -X POST 'http://127.0.0.1:20080/api/v1/users/202/greeting?name=curl' \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/json' \ + -H 'X-Trace-ID: trace-curl' \ + -d '{"message":"body-from-curl"}' +``` + +## What this proves + +The provider URL only supplies the network target, for example `rest://127.0.0.1:20080/org.apache.dubbo.samples.rest.GreetingService`. Review Comment: done ########## README.md: ########## @@ -70,6 +70,7 @@ Please refer to [HOWTO.md](HOWTO.md) for detailed instructions on running the sa * `rpc/jsonrpc`: JSON-RPC protocol example. * `rpc/triple`: Triple protocol example with multiple serialization formats. * `rpc/triple/openapi`: Demonstrates how to enable OpenAPI documentation for Triple protocol services, including versioned services and non-IDL services. + * `rpc/rest`: Rest protocol example. Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
