# 传递文本参数

现在，项目已经部署到本地ICP网络，并且可以使用dfx canister call命令进行测试。

测试部署的程序步骤如下

1. 运行下面命令来调用程序的location 方法并传递文本类型的city参数<br>

   ```
   dfx canister call location_hello location "San Francisco"
   ```

   由于参数San和Francisco之间包含一个空格，需要给参数加引号。命令输出如下

   ```
   ("Hello, San Francisco!")
   ```

   如果参数不包含空格，可以让Candid接口描述语言推断数据类型，例如

   ```
   dfx canister call location_hello location Paris
   ```

   Candid推断Paris是一个文本类型，并返回相应输出：

   ```
   ("Hello, Paris!")
   ```
2. 运行下面命令来调用程序的location 方法并显式地使用Candid接口描述语言规则来传递文本类型的city参数<br>

   ```
   dfx canister call location_hello location '("San Francisco and Paris")'
   ```

   命令输出如下：

   ```
   ("Hello, San Francisco and Paris!")
   ```

   由于程序只接收一个文本参数，给出多个字符串只会使用第一个参数。

   例如，如果运行下面的命令：

   ```
   dfx canister call location_hello location '("San Francisco","Paris","Rome")'
   ```

   只有第一个参数，也就是 **`（“Hello，San Francisco！”）`**&#x8FD4;回了。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mixdao.gitbook.io/dfinity/si-.-jiao-cheng/3.-chuan-di-wen-ben-can-shu/chuan-di-wen-ben-can-shu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
