# Can't create GET request route

**URL:** <https://meta.discourse.org/t/cant-create-get-request-route/71742>\
**Category:** Product Support\
**Created:** [October 10, 2017, 8:44am UTC](https://meta.discourse.org/t/cant-create-get-request-route/71742 "2017-10-10T08:44:48Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Mathieu](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@Mathieu](https://meta.discourse.org/u/Mathieu)\
**Post date:** [October 10, 2017, 8:44am UTC](https://meta.discourse.org/t/cant-create-get-request-route/71742/1 "2017-10-10T08:44:48Z")

</div>

Hello,

I’m trying to create a custom API on Discourse for a plugin I’m working on.  
I haven’t any problem to create a `POST` request, but when I try to create one with `GET`, it all the time returns a 404 error page.

Here is my code.

```plaintext
after_initialize do
    module ::MyApiComments
        class Engine < ::Rails::Engine
            engine_name "myapi_comments"
            isolate_namespace MyApiComments
        end
    end
   
    class MyApiComments::CommentsController < ::ApplicationController
        def get_topic_comments
            # Some stuff here
            render :json => message, :status => 200
        end
    end

    MyApiComments::Engine.routes.draw do
        get '/myapi-t/:id' => 'comments#get_topic_comments'
    end

    Discourse::Application.routes.append do
        mount ::MyApiComments::Engine, at: "/"
    end
end

```

When I use `post '/myapi-t/:id' => 'comments#get_topic_comments'`, all works fine. But I absolutely need to use a GET request and I can’t understand why it doesn’t works.

(by the way, I know there is already an API route to get topic posts, but I don’t use it for good reasons :))

Thanks for your help :).

---

_[View the full topic](https://meta.discourse.org/t/cant-create-get-request-route/71742)._
