Topic
3 replies Latest Post - ‏2013-08-21T05:45:54Z by LI Bo
Kelly Hu
Kelly Hu
3 Posts
ACCEPTED ANSWER

Pinned topic Problems met when Developing RESTful JS project

‏2013-07-31T07:38:49Z |

Hi there,

After following Developing RESTful JavaScript applications in chapter 6 of Icap.pdf, when I run the application and navigate to the URL, it worked all right for services test 1 to test 4, but showed me

{"code":"MethodNotAllowedError","message":"GET is not allowed"}

on the webpage when test service 5.

Would be appreciated if anyone could tell me why is that and help me out. Thank you!

Regards,

Kelly

Attachments

  • dwthought
    dwthought
    2 Posts
    ACCEPTED ANSWER

    Re: Problems met when Developing RESTful JS project

    ‏2013-08-01T05:18:49Z  in response to Kelly Hu

    In the old version, the app don't handle the HTTP GET request  . The new version had fixed it .

    • Kelly Hu
      Kelly Hu
      3 Posts
      ACCEPTED ANSWER

      Re: Problems met when Developing RESTful JS project

      ‏2013-08-02T01:48:43Z  in response to dwthought

      I'm using the latest version, however, I encountered this problem. I'm not sure is it a common problem, are you sure it has been fixed? Appreciated if you could help me to explain why is that. Thanks!

      • LI Bo
        LI Bo
        18 Posts
        ACCEPTED ANSWER

        Re: Problems met when Developing RESTful JS project

        ‏2013-08-21T05:45:54Z  in response to Kelly Hu

        Hi Kelly,

        Accessing service using GET is supported in all versions. 

        The reason why you got that error is that the /test5 service only supports POST, as defined in the config/services.json file:

         

        "test5": {
        "path": "/test5",
        "method": "post",
        "useSSL": false
        }

        You can change "post" to "get" then restart the JS app, then you can access it by GET.