我在芭蕾舞女演员作曲家中运行我的服务,然后我使用Windows cmd来调用服务,curl
但cmd
抱怨这curl
不是一个可识别的命令。
我怎么能做到呢cmd
?
请帮忙。
我在芭蕾舞女演员作曲家中运行我的服务,然后我使用Windows cmd来调用服务,curl
但cmd
抱怨这curl
不是一个可识别的命令。
我怎么能做到呢cmd
?
请帮忙。
hello_service.bal
.import ballerina/http;
endpoint http:Listener listener {
port:9090
};
service<http:Service> hello bind listener {
sayHello (endpoint caller, http:Request request) {
http:Response response = new;
response.setTextPayload("Hello World!\n");
_ = caller -> respond(response);
}
}
ballerina run hello_service.bal
main.bal
文件。
import ballerina/http;
import ballerina/log;
import ballerina/io;
endpoint http:Client clientEndpoint {
url: "http://localhost:9090"
};
function main(string... args) {
// Send a GET request to the Hello World service endpoint.
var response = clientEndpoint->get("/hello/sayHello");
match response {
http:Response resp => {
io:println(resp.getTextPayload());
}
error err => {
log:printError(err.message, err = err);
}
}
}
ballerina run main.bal
.
Hello World!
5. 你现在可以在cmd上
看到结果了。