> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/v.-spring-boot-actuator/50.-endpoints/50.8-implementing-custom-endpoints/50.8.1-receiving-input.md).

# 50.8.1 接收输入

在一个端点上的操作会通过它们的参数接收数据。当该端点通过网络暴露的时候，这些参数的值取自URL查询参数和JSON请求体。当该端点通过JMX暴露的时候，这些参数会映射到MBean操作的参数上。参数默认必需。但是，它们可以通过标注`@org.springframework.lang.Nullable`成为可选项。

**注** 为了允许输入映射到操作方法的参数上，实现端点的代码应该带上`-parameters`编译。如果你正在使用Spring Boot的Gradle插件，或是Maven和`spring-boot-starter-parent`，这会自动发生。

**输入类型转换**

如果需要，传递到端点操作方法的参数会自动转换到需要的类型。在调用操作方法之前，通过JMX或者HTTP请求接收的输入会使用`ApplicationConversionService`的实例转换到需要的类型。
