【问题标题】:Apache Camel with Spring Boot integration REST APIApache Camel 与 Spring Boot 集成 REST API
【发布时间】:2020-10-24 18:32:00
【问题描述】:

我正在使用 Spring Boot 学习 Apache Camel,我一直在尝试遵循以下示例:https://www.baeldung.com/apache-camel-spring-boot

它告诉我运行文件并向 http://localhost:8080/camel/api/bean 发出 POST 请求并包含 HEADER: Content-Type: application/json{"id": 1,"name": "World"} 的正文有效负载。我该怎么做?

【问题讨论】:

    标签: curl post postman


    【解决方案1】:

    您可以下载 Postman 并使用它来发出请求。

    【讨论】:

      【解决方案2】:

      这意味着您从 IDE 运行 Application.class 文件并使用 cURL 或 POSTMAN(您需要下载的软件)发送 POST 请求

      POST 是万维网使用的 HTTP 支持的请求方法。你可以阅读更多关于 POST 请求here

      cURL 是一个命令行工具,代表客户端 URL。你可以阅读更多关于它here

      cURL 示例:

      curl -d '{"id": 1,"name": "World"}' -X POST http://localhost:8080/camel/api/bean
      

      Postman 在尝试剖析他人制作的 RESTful API 或测试您自己制作的 API 时是一个很好的工具。它提供了一个流畅的用户界面来发出 HTML 请求,而无需编写一堆代码来测试 API 的功能。

      here下载邮递员

      Here 是一个使用 PostMan App 发送 POST 请求的教程

      不过,Postman 还有很多其他不错的alternatives,您也可以尝试一下。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-08-24
        • 1970-01-01
        • 2016-10-26
        • 1970-01-01
        • 2017-06-24
        • 2018-01-17
        • 1970-01-01
        相关资源
        最近更新 更多