Results 1 to 5 of 5

Thread: doubt about rest url

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2013
    Posts
    584
    Answers
    3

    Default doubt about rest url

    anyone know if sencha can work with the rest url just like backbone? example:


    http://mysite.com/user/123 // get the user 123


    http://mysite.com/user/123/son/1 // get the son 1 from user 123


    http://mysite.com/user/123/son/2 // get the son 2 from user 123


    so far I only managed to use http://mysite.com/user?cd=123&son=3


    tks

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

  3. #3
    Sencha Premium Member
    Join Date
    Oct 2013
    Posts
    584
    Answers
    3

    Default

    i already have looked. but at the doc he only have example to first level from url

    http://mysite.com/user/123 // get the user 123

    don't have the others level.:

    http://mysite.com/user/123/son/1 // get the son 1 from user 123
    http://mysite.com/user/123/son/2 // get the son 2 from user 123

    and in my tests i can't do this

  4. #4
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    32

    Default

    Quote Originally Posted by fabioebner View Post
    i already have looked. but at the doc he only have example to first level from url

    http://mysite.com/user/123 // get the user 123

    don't have the others level.:

    http://mysite.com/user/123/son/1 // get the son 1 from user 123
    http://mysite.com/user/123/son/2 // get the son 2 from user 123

    and in my tests i can't do this
    The default format that the Rest proxy will use is that which Gary linked to. You can, of course, create your own proxy which extends the Rest proxy and overrides the buildUrl method. In this method, you can implement whatever logic you'd like to create any format of URL that you need.
    Before pasting your code, see if you can make a working example using Sencha Fiddle: https://fiddle.sencha.com/

    Not only will it let everyone see what you're talking about with their own eyes, but it also makes debugging your issue 19 billion times easier

    Embedding your newly created Fiddle is super-easy: Using Sencha Fiddle in the Forums

  5. #5
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    Have a read of the source code for the Rest proxy. There's only a handful of lines, it's dead easy to understand.

    For more on writing a custom proxy see:

    http://skirtlesden.com/articles/custom-proxies

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •