我有一个Spring Boot应用程序,在其中一个类中,我尝试使用application.properties文件引用属性@Value.但是,该财产没有得到解决.我查看了类似的帖子,并尝试按照建议,但这没有帮助.这堂课是:
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class PrintProperty {
@Value("${file.directory}")
private String fileDirectory;
public void print() {
System.out.println(fileDirectory);
}
}
Run Code Online (Sandbox Code Playgroud)
我有属性file.directory application.properties.我也有其他领域.
我能够使用Apache Camel将GET请求发送到REST服务,现在我正尝试使用Apache Camel发送具有JSON正文的POST请求。我无法弄清楚如何添加JSON正文和发送请求。如何添加JSON正文,发送请求并获取响应代码?