# Adding a route with a POST method

**URL:** <https://forum.inductiveautomation.com/t/adding-a-route-with-a-post-method/69952>\
**Category:** Module Development\
**Created:** [February 16, 2023, 4:28pm UTC](https://forum.inductiveautomation.com/t/adding-a-route-with-a-post-method/69952 "2023-02-16T16:28:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [February 16, 2023, 4:28pm UTC](https://forum.inductiveautomation.com/t/adding-a-route-with-a-post-method/69952/1 "2023-02-16T16:28:38Z")

</div>

I am working on building out a module that includes a GET and a POST method on an endpoint.

The GET endpoint is working great and just added with:

```auto
this.routes.newRoute("/my/endpoint")
                .handler(this::getData)
                .type(TYPE_JSON)
                .mount();

```

However the same way of describing the POST endpoint doesn't seem to be working?

If I just execute a `curl <my-path>/my/endpoint` then it works fine

However a `curl -X POST -d @my-file.json <my-path>/my/endpoint` I get a 404 that the page isn't there.

Is there something different I need to add to the route definition for it to see the POST request?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 16, 2023, 4:30pm UTC](https://forum.inductiveautomation.com/t/adding-a-route-with-a-post-method/69952/2 "2023-02-16T16:30:10Z")

</div>

See `RouteMounter::method`. You can specify the method, it defaults to GET when not specified.

---

<div class="post-metadata">

**Author:** ![jimender2](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jimender2](https://forum.inductiveautomation.com/u/jimender2)\
**Post date:** [February 26, 2023, 12:23am UTC](https://forum.inductiveautomation.com/t/adding-a-route-with-a-post-method/69952/3 "2023-02-26T00:23:28Z")

</div>

I have a tutorial here of how to add routes.

> **[GitHub - jimender2/Webroutes-Ignition](https://github.com/jimender2/Webroutes-Ignition)**
>
> Contribute to jimender2/Webroutes-Ignition development by creating an account on GitHub.
