What is the best language for RESTful? [closed]

0

I'm a PHP programmer, but I'm having a hard time finding useful ways to do REST. And so I'm aiming to learn a second language, I already know some, but there might be a better way to do Rest.

Please tell me why the above language is the best to do REST.

    
asked by anonymous 08.05.2015 / 19:45

2 answers

4

There is no language that is best for REST so directly.

I'll leave a recommendation, Python!

There are many interesting tools to develop RESTFULL API in python among them Web2py, Django

Web2py

Doc REST + web2py

Example:

@request.restful()
def api():
    response.view = 'generic.'+request.extension
    def GET(*args,**vars):
        patterns = [
            "/friends[person]",
            "/friend/{person.name.startswith}",
            "/friend/{person.name}/:field",
            "/friend/{person.name}/pets[pet.owner]",
            "/friend/{person.name}/pet[pet.owner]/{pet.name}",
            "/friend/{person.name}/pet[pet.owner]/{pet.name}/:field"
            ]
        parser = db.parse_as_rest(patterns,args,vars)
        if parser.status == 200:
            return dict(content=parser.response)
        else:
            raise HTTP(parser.status,parser.error)
    def POST(table_name,**vars):
        if table_name == 'person':
            return db.person.validate_and_insert(**vars)
        elif table_name == 'pet':
            return db.pet.validate_and_insert(**vars)
        else:
            raise HTTP(400)
    return locals()

Novatec has just released a book on REST with Django, book link

Topics:

  • Learn an uncomplicated approach to starting a new Django project.
  • Separate reusable applications into smaller services that communicate with each other.
  • Create a static website using rapid prototyping as a framework for websites and applications.
  • Create a REST API with django-rest-framework.
  • Learn how to use Django with the MVC Backbone.js framework.
  • Create a single-page web application using your REST API.
  • Integrate real-time capabilities with WebSockets and the Tornado network library.
  • Use the code-oriented examples from the book in your own projects.
08.05.2015 / 20:19
2

REST is an architecture style, and RESTfull is a web service that uses this paradigm. As you know PHP, it is verified in SLIM and SILEX that they are two micro-frameworks that facilitate the use of RESTful. But there is no language that is "better" for RESTfull.

    
08.05.2015 / 21:00