This document discusses the Laravel PHP framework and provides an overview of its key characteristics and features. It highlights aspects like Eloquent ORM, routing, MVC architecture, Blade templating, easy creation of RESTful APIs, and Artisan CLI. It also mentions features like authentication, forms, validation, caching, testing, and more. The document concludes with an example tutorial for building a RESTful API in Laravel involving models, controllers and JSON responses.
Web service with Laravel:
Laravel Philosophy
Requirement
Installation
Basic Routing
Requests & Input
Request Lifecycle
Controller
Controller Filters
RESTful Controllers
Database Model using Eloquent ORM
Creating A Migration
Code Example
The session was about how to create the Restful Web Services with Laravel, a PHP framework with the minimal code. Topics discussed are:
-Laravel Philosophy
-Requirement
-Installation
-Basic Routing
-Requests & Input
-Request Lifecycle
-Creating A Migration
-Controller
-Controller Filters
-RESTful Controllers
-Database
-Eloquent ORM
This document summarizes a presentation about integrating JavaScript with Laravel. The speaker will explore building a game using Laravel and demonstrate how to:
1) Prepare Laravel by installing packages, generating database migrations and models, and setting up routes and controllers.
2) Add jQuery and custom scripts to views using Blade templating.
3) Pass PHP data to JavaScript in templates, either directly or using the laracasts/utilities package.
4) Make AJAX calls from JavaScript to Laravel controllers to retrieve and update data, including using named routes from the laravel-js-routes package.
RESTful APIs are useful when developing a modern web application since they allow for multiple possibilities for collaboration with third-party software as well as multiple types of front-ends, such as mobile apps and HTML5 web applications. The creation of RESTful API’s is facilitated using Laravel 4, a PHP 5.3 Framework that is rapidly growing in popularity. Laravel’s features such as the facade pattern allow for easy-to-read code and expressive ORM statements.
Handling RESTful API requests with Laravel PHP Framework resource controllers is already very easy. With Laravel 5, handling request routing has been made even easier by using a configuration-as-annotation approach. Controller annotations may take advantage of doc block-style syntax and then be compiled using Laravel's artisan command-line tool. I'll present this approach by providing a few examples and discussing some of the pros and cons.
This document provides an overview of Laravel, a popular PHP framework. It discusses what Laravel is, why it is popular, and some of its core components like routing, controllers, models, migrations and views. Key points include: Laravel uses MVC architecture and is composer-based; it includes features like routing, controllers, Eloquent ORM, schema builder, migrations and seeding to interact with databases, and blade templating for views. Requirements to use Laravel are PHP 5.4+, composer, and database extensions like MySQL.
This document discusses the Laravel PHP framework and provides an overview of its key characteristics and features. It highlights aspects like Eloquent ORM, routing, MVC architecture, Blade templating, easy creation of RESTful APIs, and Artisan CLI. It also mentions features like authentication, forms, validation, caching, testing, and more. The document concludes with an example tutorial for building a RESTful API in Laravel involving models, controllers and JSON responses.
Web service with Laravel:
Laravel Philosophy
Requirement
Installation
Basic Routing
Requests & Input
Request Lifecycle
Controller
Controller Filters
RESTful Controllers
Database Model using Eloquent ORM
Creating A Migration
Code Example
The session was about how to create the Restful Web Services with Laravel, a PHP framework with the minimal code. Topics discussed are:
-Laravel Philosophy
-Requirement
-Installation
-Basic Routing
-Requests & Input
-Request Lifecycle
-Creating A Migration
-Controller
-Controller Filters
-RESTful Controllers
-Database
-Eloquent ORM
This document summarizes a presentation about integrating JavaScript with Laravel. The speaker will explore building a game using Laravel and demonstrate how to:
1) Prepare Laravel by installing packages, generating database migrations and models, and setting up routes and controllers.
2) Add jQuery and custom scripts to views using Blade templating.
3) Pass PHP data to JavaScript in templates, either directly or using the laracasts/utilities package.
4) Make AJAX calls from JavaScript to Laravel controllers to retrieve and update data, including using named routes from the laravel-js-routes package.
RESTful APIs are useful when developing a modern web application since they allow for multiple possibilities for collaboration with third-party software as well as multiple types of front-ends, such as mobile apps and HTML5 web applications. The creation of RESTful API’s is facilitated using Laravel 4, a PHP 5.3 Framework that is rapidly growing in popularity. Laravel’s features such as the facade pattern allow for easy-to-read code and expressive ORM statements.
Handling RESTful API requests with Laravel PHP Framework resource controllers is already very easy. With Laravel 5, handling request routing has been made even easier by using a configuration-as-annotation approach. Controller annotations may take advantage of doc block-style syntax and then be compiled using Laravel's artisan command-line tool. I'll present this approach by providing a few examples and discussing some of the pros and cons.
This document provides an overview of Laravel, a popular PHP framework. It discusses what Laravel is, why it is popular, and some of its core components like routing, controllers, models, migrations and views. Key points include: Laravel uses MVC architecture and is composer-based; it includes features like routing, controllers, Eloquent ORM, schema builder, migrations and seeding to interact with databases, and blade templating for views. Requirements to use Laravel are PHP 5.4+, composer, and database extensions like MySQL.
This document provides an introduction and overview of the Laravel PHP framework. It discusses key Laravel features such as routing, controllers, Eloquent ORM, Artisan CLI, and more. Installation involves using Composer to create a new Laravel project. Resources for learning Laravel include its documentation, Laracasts tutorials, and Leanpub books.
This document provides an overview of the Laravel PHP framework. It discusses Laravel's history and evolution from version 1 to the current version 5.3. Key Laravel concepts are explained such as routing, controllers, models, views, Artisan commands, and architectural changes in version 5 like the directory structure and environment detection. Additional Laravel tools and resources are also mentioned like Laravel Elixir, Homestead, and Laracasts.
Jab14 exemple of integration of Joomla and slim Framework
http://jandbeyond.org/program/sessions/dont-worry-be-api-best-practices-and-implementatio.html
In the context of a website or web application, an application-programming interface or API allows software developers to interact with and build upon the data and/or services delivered by your website. Thus, APIs provide limitless flexibility, reach and innovative potential for any website, service or application.
During the last few months, Pierre-André has performed extensive research and development to discover effective ways of adding an API to a Joomla website. In this interactive session, he will share his findings.
Attendees can expect to learn, why you need an API for your web site, the pros and cons of various API solutions, and why a RESTful API is a good fit for Joomla. Best practices for implementing a well-documented, pragmatic, and RESTful API will be discussed, along with useful tools and sample code for using the com_api component as well as Slim Framework.
Laravel is an MVC framework for PHP that focuses on unit testing and DRY principles. It is based on Symfony but has a lower learning curve. Laravel uses Composer as a package manager and features include Eloquent ORM, query builders, database migrations, RESTful controllers, queue management, and payment API support through packages. While powerful, it can be heavyweight for some uses and there is no built-in admin panel, but packages provide these features. The lighter-weight Lumen framework was also created by the same developer.
Brian Feaver gives an overview of the Laravel PHP framework. He explains that Laravel is built on Symfony components and provides services and libraries to make interacting with web requests easier. The basics covered include routing, controllers, templating with Blade, and Eloquent ORM. Cool features highlighted are Artisan, dependency injection, queues, middleware, filesystem abstraction, and built-in authentication. Facades are discussed as a way to access underlying services, though injecting services directly is preferable.
Adventures in Laravel 5 SunshinePHP 2016 TutorialJoe Ferguson
Laravel 5 introduces several new features including a revised directory structure, Blade changes, commands, events, form requests, and helpers. It also includes tools like route caching, middleware, controller method injection, implicit route model binding, API rate limiting, and authentication improvements. The document provides an overview of these new features and changes as well as tips for upgrading from Laravel 4.2 to 5.x.
Vikas Chauhan presented a document outlining 5 exercises for learning Laravel: 1) Installation and configuration, 2) Writing a Hello World program, 3) Using Laravel Blade templates, 4) Implementing layouts with Blade, and 5) Different types of routes. Each exercise includes multiple tasks with instructions on creating controllers, views, and routes to demonstrate different Laravel features.
Creating your own framework on top of Symfony2 ComponentsDeepak Chandani
Symfony is a set of reusable standalone PHP components that can be used to solve many web dev problems. We will pick some of the important components (bricks) & will create our own framework on top of those bricks.
Slim Framework 3.x entered beta in July 2015. This presentation introduces you to the main components of the framework, including the router, request and response objects, middleware, and dependency injection. The next best thing will be the docs on Slim's website, which are still a work in progress for 3.x, and the code itself - it's not hard to follow and is designed to be read.
This document provides an overview of building web applications with Ruby on Rails. It discusses the core components of a Rails app including models, views, controllers, and database migrations. It also covers generating scaffolds, ActiveRecord queries in the console, embedded Ruby syntax in views, layouts, and view helpers. The goal is to explain the anatomy and basic functionality of a Rails application.
Laravel, längst kein unbestriebenes Blatt mehr, gewinnt immer mehr an Popularität.
In diesem Vortrag wir Laravel kurz vorgestellt mit Themen wie:
- Was ist Laravel?
- Woher kommt Laravel?
- Was bietet Laravel?
- Laravel und sein Ecosystem.
und einiges mehr...
This document provides an overview and recap of key concepts in building web applications with Ruby on Rails, including the Rails console, ActiveRecord queries, views with embedded Ruby and layouts, helper methods, models, controllers, routing, validations, and associations. It discusses using the Rails console to run ActiveRecord queries. It also covers defining routes and generating RESTful routes, writing controller actions, and linking views to controllers. Finally, it discusses writing tests to validate models, and setting up associations between the Station and Stream models using has_many and belongs_to.
Knowing Laravel 5 : The most popular PHP frameworkBukhori Aqid
This document summarizes Laravel, a popular PHP framework. It notes that Laravel is the most starred PHP framework on GitHub, with over 4.8 million stars. The document then provides an overview of Laravel's features, which include Composer, routing, resource controllers, Eloquent ORM, Blade templating, Artisan CLI, and migrations. It also summarizes some of Laravel 5's new features, such as its new folder structure, contracts, route middleware, controller method injection, scheduler, Tinker/Psysh, DotEnv, Laravel Elixir, Socialite, and form requests.
This document provides an overview of the Laravel PHP framework. It describes key Laravel concepts like MVC architecture, Eloquent ORM, Blade templating, routing, controllers, authentication, Artisan CLI, and Inversion of Control using service providers. It also lists requirements to set up a Laravel project and ways to create one using the Laravel installer or Composer.
Introduction to Laravel Framework (5.2)Viral Solani
This document provides an overview of the Laravel PHP framework, including why it was created, its main features and components. Some key points:
- Laravel was created to guide developers to best practices and utilizes modern PHP features. It has an active community and good documentation.
- Its major components include routing, controllers, blade templating, Eloquent ORM, authentication, queues and more. It also uses Composer for dependency management.
- Other tools in the Laravel ecosystem help with deployment (Homestead, Forge), billing (Cashier), APIs (Lumen) and more. The framework is fully-featured but aims to be easy to learn and use.
This document discusses adding authentication to a Rails application using the Devise gem. It covers generating a User model with Devise, installing Devise and its dependencies, and configuring authentication features like login, logout, and restricting access to controllers. Key aspects include:
1. Generating a User model with rails generate devise:install.
2. Adding Devise and its dependencies to the Gemfile and running bundle install.
3. Adding authentication checks like user_signed_in? and current_user to views.
4. Restricting controller actions with a before_filter to authenticate users.
This document provides an overview and introduction to Laravel 5, a PHP web application framework. It discusses key Laravel 5 concepts and features such as Eloquent ORM, routing, middleware, contracts, form requests, the IoC container, file drivers, scheduling commands, and the command bus pattern. The document is intended to explain Laravel 5 concepts through code examples and brief explanations.
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)Roes Wibowo
Laravel 5 is a PHP web framework that was released in February 2015. Some key new features in Laravel 5 include improved folder structure, use of DotEnv for environment variables, caching of routes and configuration, inclusion of the Symfony VarDumper component, more robust middleware system, explicit contracts, method injection in controllers, changes to Blade templating, and integration of the Flysystem library for cloud storage support. Laravel 5 also removed some features present in earlier versions like annotations for routing and models.
This document discusses REST APIs using Spring MVC and Spring Data. It covers:
1. The REST constraints of being stateless, using HTTP caching, and having a uniform interface.
2. Implementing RESTful resources and operations in Spring MVC using request mappings, path variables, and response status codes.
3. Using Spring Data JPA repositories to access and query data from the persistence layer.
4. Testing REST services through both live tests of the deployed API and lower level integration and unit tests.
In this presentation, we will explore the RESTApi as the ClearPass API integrations and further developments are more focused to RESTApi than the other existing API services like xml-rpc, SOAP, etc.Check out the webinar recording where this presentation was used: http://community.arubanetworks.com/t5/Security/Technical-Webinar-Getting-Started-with-the-ClearPass-REST-API/td-p/410214
Register for the upcoming webinars: https://community.arubanetworks.com/t5/Training-Certification-Career/EMEA-Airheads-Webinars-Jul-Dec-2017/td-p/271908
This document provides an introduction and overview of the Laravel PHP framework. It discusses key Laravel features such as routing, controllers, Eloquent ORM, Artisan CLI, and more. Installation involves using Composer to create a new Laravel project. Resources for learning Laravel include its documentation, Laracasts tutorials, and Leanpub books.
This document provides an overview of the Laravel PHP framework. It discusses Laravel's history and evolution from version 1 to the current version 5.3. Key Laravel concepts are explained such as routing, controllers, models, views, Artisan commands, and architectural changes in version 5 like the directory structure and environment detection. Additional Laravel tools and resources are also mentioned like Laravel Elixir, Homestead, and Laracasts.
Jab14 exemple of integration of Joomla and slim Framework
http://jandbeyond.org/program/sessions/dont-worry-be-api-best-practices-and-implementatio.html
In the context of a website or web application, an application-programming interface or API allows software developers to interact with and build upon the data and/or services delivered by your website. Thus, APIs provide limitless flexibility, reach and innovative potential for any website, service or application.
During the last few months, Pierre-André has performed extensive research and development to discover effective ways of adding an API to a Joomla website. In this interactive session, he will share his findings.
Attendees can expect to learn, why you need an API for your web site, the pros and cons of various API solutions, and why a RESTful API is a good fit for Joomla. Best practices for implementing a well-documented, pragmatic, and RESTful API will be discussed, along with useful tools and sample code for using the com_api component as well as Slim Framework.
Laravel is an MVC framework for PHP that focuses on unit testing and DRY principles. It is based on Symfony but has a lower learning curve. Laravel uses Composer as a package manager and features include Eloquent ORM, query builders, database migrations, RESTful controllers, queue management, and payment API support through packages. While powerful, it can be heavyweight for some uses and there is no built-in admin panel, but packages provide these features. The lighter-weight Lumen framework was also created by the same developer.
Brian Feaver gives an overview of the Laravel PHP framework. He explains that Laravel is built on Symfony components and provides services and libraries to make interacting with web requests easier. The basics covered include routing, controllers, templating with Blade, and Eloquent ORM. Cool features highlighted are Artisan, dependency injection, queues, middleware, filesystem abstraction, and built-in authentication. Facades are discussed as a way to access underlying services, though injecting services directly is preferable.
Adventures in Laravel 5 SunshinePHP 2016 TutorialJoe Ferguson
Laravel 5 introduces several new features including a revised directory structure, Blade changes, commands, events, form requests, and helpers. It also includes tools like route caching, middleware, controller method injection, implicit route model binding, API rate limiting, and authentication improvements. The document provides an overview of these new features and changes as well as tips for upgrading from Laravel 4.2 to 5.x.
Vikas Chauhan presented a document outlining 5 exercises for learning Laravel: 1) Installation and configuration, 2) Writing a Hello World program, 3) Using Laravel Blade templates, 4) Implementing layouts with Blade, and 5) Different types of routes. Each exercise includes multiple tasks with instructions on creating controllers, views, and routes to demonstrate different Laravel features.
Creating your own framework on top of Symfony2 ComponentsDeepak Chandani
Symfony is a set of reusable standalone PHP components that can be used to solve many web dev problems. We will pick some of the important components (bricks) & will create our own framework on top of those bricks.
Slim Framework 3.x entered beta in July 2015. This presentation introduces you to the main components of the framework, including the router, request and response objects, middleware, and dependency injection. The next best thing will be the docs on Slim's website, which are still a work in progress for 3.x, and the code itself - it's not hard to follow and is designed to be read.
This document provides an overview of building web applications with Ruby on Rails. It discusses the core components of a Rails app including models, views, controllers, and database migrations. It also covers generating scaffolds, ActiveRecord queries in the console, embedded Ruby syntax in views, layouts, and view helpers. The goal is to explain the anatomy and basic functionality of a Rails application.
Laravel, längst kein unbestriebenes Blatt mehr, gewinnt immer mehr an Popularität.
In diesem Vortrag wir Laravel kurz vorgestellt mit Themen wie:
- Was ist Laravel?
- Woher kommt Laravel?
- Was bietet Laravel?
- Laravel und sein Ecosystem.
und einiges mehr...
This document provides an overview and recap of key concepts in building web applications with Ruby on Rails, including the Rails console, ActiveRecord queries, views with embedded Ruby and layouts, helper methods, models, controllers, routing, validations, and associations. It discusses using the Rails console to run ActiveRecord queries. It also covers defining routes and generating RESTful routes, writing controller actions, and linking views to controllers. Finally, it discusses writing tests to validate models, and setting up associations between the Station and Stream models using has_many and belongs_to.
Knowing Laravel 5 : The most popular PHP frameworkBukhori Aqid
This document summarizes Laravel, a popular PHP framework. It notes that Laravel is the most starred PHP framework on GitHub, with over 4.8 million stars. The document then provides an overview of Laravel's features, which include Composer, routing, resource controllers, Eloquent ORM, Blade templating, Artisan CLI, and migrations. It also summarizes some of Laravel 5's new features, such as its new folder structure, contracts, route middleware, controller method injection, scheduler, Tinker/Psysh, DotEnv, Laravel Elixir, Socialite, and form requests.
This document provides an overview of the Laravel PHP framework. It describes key Laravel concepts like MVC architecture, Eloquent ORM, Blade templating, routing, controllers, authentication, Artisan CLI, and Inversion of Control using service providers. It also lists requirements to set up a Laravel project and ways to create one using the Laravel installer or Composer.
Introduction to Laravel Framework (5.2)Viral Solani
This document provides an overview of the Laravel PHP framework, including why it was created, its main features and components. Some key points:
- Laravel was created to guide developers to best practices and utilizes modern PHP features. It has an active community and good documentation.
- Its major components include routing, controllers, blade templating, Eloquent ORM, authentication, queues and more. It also uses Composer for dependency management.
- Other tools in the Laravel ecosystem help with deployment (Homestead, Forge), billing (Cashier), APIs (Lumen) and more. The framework is fully-featured but aims to be easy to learn and use.
This document discusses adding authentication to a Rails application using the Devise gem. It covers generating a User model with Devise, installing Devise and its dependencies, and configuring authentication features like login, logout, and restricting access to controllers. Key aspects include:
1. Generating a User model with rails generate devise:install.
2. Adding Devise and its dependencies to the Gemfile and running bundle install.
3. Adding authentication checks like user_signed_in? and current_user to views.
4. Restricting controller actions with a before_filter to authenticate users.
This document provides an overview and introduction to Laravel 5, a PHP web application framework. It discusses key Laravel 5 concepts and features such as Eloquent ORM, routing, middleware, contracts, form requests, the IoC container, file drivers, scheduling commands, and the command bus pattern. The document is intended to explain Laravel 5 concepts through code examples and brief explanations.
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)Roes Wibowo
Laravel 5 is a PHP web framework that was released in February 2015. Some key new features in Laravel 5 include improved folder structure, use of DotEnv for environment variables, caching of routes and configuration, inclusion of the Symfony VarDumper component, more robust middleware system, explicit contracts, method injection in controllers, changes to Blade templating, and integration of the Flysystem library for cloud storage support. Laravel 5 also removed some features present in earlier versions like annotations for routing and models.
This document discusses REST APIs using Spring MVC and Spring Data. It covers:
1. The REST constraints of being stateless, using HTTP caching, and having a uniform interface.
2. Implementing RESTful resources and operations in Spring MVC using request mappings, path variables, and response status codes.
3. Using Spring Data JPA repositories to access and query data from the persistence layer.
4. Testing REST services through both live tests of the deployed API and lower level integration and unit tests.
In this presentation, we will explore the RESTApi as the ClearPass API integrations and further developments are more focused to RESTApi than the other existing API services like xml-rpc, SOAP, etc.Check out the webinar recording where this presentation was used: http://community.arubanetworks.com/t5/Security/Technical-Webinar-Getting-Started-with-the-ClearPass-REST-API/td-p/410214
Register for the upcoming webinars: https://community.arubanetworks.com/t5/Training-Certification-Career/EMEA-Airheads-Webinars-Jul-Dec-2017/td-p/271908
Best Practices for Architecting a Pragmatic Web API.Mario Cardinal
This presentation teach how to design a real-world and pragmatic web API. It draws from the experience Mario Cardinal have gained over the years being involved architecting many Web API. This presentation begins by differencing between a Web and a REST API, and then continue with the design process. We conclude with the core learnings of the session which is a review of the best practices when designing a web API. Armed with skills acquired, you can expect to see significant improvements in your ability to design a pragmatic web API.
This document provides an overview of the Globus platform and APIs for developers. It describes Globus Auth for identity and access management, the Globus Transfer API for file sharing and transfer, and the Globus Python SDK. It covers authentication flows, scopes, and how to programmatically activate endpoints and get user consent for data access using the Transfer API and SDK. The document recommends additional Globus documentation, code samples, and other support resources for developers to integrate Globus capabilities into their applications.
Леонід Кузьмін “Сам собі паблішер. Від сайту ігрової студії до універсального...Lviv Startup Club
Леонід Кузьмін “Сам собі паблішер. Від сайту ігрової студії до універсального back-end провайдера і сервісу публікації ігор.”
http://gamedev.lviv.ua
https://www.facebook.com/startuplviv
https://twitter.com/gdlviv
These were prepared to teach the module "Emerging Technologies" for the 3rd year Undergraduates of the Asia Pacific Institue of Information Technology, Colombo-2, Sri Lanka (Remotely)
This document provides an overview of ASP.NET MVC 4 Web API. It discusses what an API is and why Web API is used. It covers key concepts like HTTP, REST, JSON. It describes features of Web API like routing, error handling, model validation, OData support, media formatters, and security. It also discusses using the HttpClient class and future plans.
This document provides an overview and introduction to using the REST API for a social networking platform called Zyncro. It discusses REST API concepts like resources, endpoints, HTTP methods, authentication using OAuth, and includes code samples in languages like PHP, Java, and Python. Entities exposed through the API like users, groups, events, documents are also summarized. The document aims to help developers get started with building applications that integrate with Zyncro using its RESTful API.
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and PythonCisco DevNet
Are you new to coding? This session will get you started using REST, Python. We will cover coding basics and create some simple examples that retrieve, parse and display JSON data using the Cisco APIC-EM REST APIs. Bring your laptop and we’ll help you get your own development environment set up so you can code with us.
The document provides an overview of REST APIs and how they can be used to build web applications. It discusses HTTP and URLs, defines REST and its architectural constraints, and shows how to implement REST principles using HTTP methods, URLs and response codes. The document also covers REST API design best practices like versioning, limiting fields, using JSON format, and handling errors properly. It provides resources for further reading on REST APIs and their implementation.
Building RESTful applications using Spring MVCIndicThreads
REST is an alternate and simpler approach for implementing WebServices. It is based on the HTTP protocol and hence leverages a lot of existing infrastructures. It uses an uniform interface thus making it easy to build client applications. In this session we will look at the fundamental concepts behind REST (Resource, URI, Stateless Conversation ..) and how to apply it in the context of a real applcation. We will also discuss the pros & cons of RESTful vs Soap based webservices. We will discuss the design of RESTful application and then look at how to implement it using Spring MVC.
This was my talk at Detroit Startup Week 2017 about the WordPress REST API. The goal was to build a foundation for REST APIs then how to use WordPress' core REST API to build upon.
This document provides an overview of REST basics and how to implement REST with Spring. It discusses:
1. The differences between SOAP and REST web services standards and how REST uses HTTP methods to perform CRUD operations on nouns instead of defining complex operations.
2. Key aspects of REST including the REST triangle of nouns, verbs, and content types. It also covers common REST frameworks and HTTP methods, headers, and status codes.
3. How Spring supports REST with annotations like @RequestMapping and @ResponseBody to build RESTful web services, and uses the DispatcherServlet to route HTTP requests to controller methods.
4. An example of a basic RESTful web service implemented with
The rising complexity and cost of managing legacy travel distribution systems are leading many travel companies today to adopt a REST (REpresentational State Transfer) architectural style because it provides standardized resources that enable precise interaction with other REST systems. The panelists will discuss the fundamental shift in application design required to begin thinking in terms of resources rather than objects and methods and how the OpenTravel 2.0 specification is being designed to provide a common XML resource model for the travel industry.
Spring Social - Messaging Friends & Influencing PeopleGordon Dickens
Conference Abstract:
This session will focus on integrating with social media with your Spring projects. The Spring Social project allows developers to interact with Twitter, LinkedIn, Facebook & TripIt in web and mobile projects. We will discuss security concerns with OAuth 1.0 & 2.0 and how Spring templates make our job easier.
Topics Include:
- Spring Greenhouse - reference implementation of Spring Social
- Spring Mobile - integrating Spring Social with iPhone & Android
- Security with OAuth
- Accessing Social data with REST, JSON & XML
- Examples of Spring Social Media Templates
Adding Identity Management and Access Control to your Application - ExersicesÁlvaro Alonso González
This document outlines a series of exercises for adding identity management and access control to applications using FIWARE. The exercises include creating a FIWARE account, registering an application, adding OAuth2 authentication, and securing the backend application using Wilma and different authorization techniques ranging from basic to advanced authorization rules. Completing the exercises provides hands-on experience with key FIWARE security services and capabilities.
Securing RESTful APIs using OAuth 2 and OpenID ConnectJonathan LeBlanc
Constructing a successful and simple API is the lifeblood of your developer community, and REST is a simple standard through which this can be accomplished. As we construct our API and need to secure the system to authenticate and track applications making requests, the open standard of OAuth 2 provides us with a secure and open source method of doing just this. In this talk, we will explore REST and OAuth 2 as standards for building out a secure API infrastructure, exploring many of the architectural decisions that PayPal took in choosing variations in the REST standard and specific implementations of OAuth 2.
Amazon API Gateway is a fully managed service that makes it easy for developers to create, deploy, secure and monitor APIs at any scale. In this session, you’ll find out how you can quickly declare an API interface and connect it to any public HTTP endpoint, existing web service running on Amazon Elastic Compute Cloud (Amazon EC2) or code running on AWS Lambda. Amazon API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management. Join us for this introductory session to Amazon API Gateway.
The document discusses OAuth 2.0 libraries for PHP and Ruby. For PHP, it describes thephpleague/oauth2-client library which allows configuring 3 endpoint URLs and implementing the OAuth flow with conditional checks. For Ruby, it mentions omniauth/omniauth libraries like omniauth-twitter which simplify implementation by handling most complexity, with differences only in the 3 URLs. It also describes Doorkeeper for developing OAuth servers in Ruby on Rails, which works with Devise and allows registering client apps and users through predefined functions.
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...Jitendra Bafna
The document discusses API and RAML design best practices and guidelines that were presented at a MuleSoft meetup. It covers REST API design best practices like using nouns in URIs, HTTP verbs to define actions, versioning APIs, and status codes. It also discusses RAML design best practices like using plural nouns, sub-resources to represent relations, and URI structure. The agenda includes talks on these topics and a networking session.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...kalichargn70th171
A dynamic process unfolds in the intricate realm of software development, dedicated to crafting and sustaining products that effortlessly address user needs. Amidst vital stages like market analysis and requirement assessments, the heart of software development lies in the meticulous creation and upkeep of source code. Code alterations are inherent, challenging code quality, particularly under stringent deadlines.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
Odoo ERP software
Odoo ERP software, a leading open-source software for Enterprise Resource Planning (ERP) and business management, has recently launched its latest version, Odoo 17 Community Edition. This update introduces a range of new features and enhancements designed to streamline business operations and support growth.
The Odoo Community serves as a cost-free edition within the Odoo suite of ERP systems. Tailored to accommodate the standard needs of business operations, it provides a robust platform suitable for organisations of different sizes and business sectors. Within the Odoo Community Edition, users can access a variety of essential features and services essential for managing day-to-day tasks efficiently.
This blog presents a detailed overview of the features available within the Odoo 17 Community edition, and the differences between Odoo 17 community and enterprise editions, aiming to equip you with the necessary information to make an informed decision about its suitability for your business.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
What is Augmented Reality Image Trackingpavan998932
Augmented Reality (AR) Image Tracking is a technology that enables AR applications to recognize and track images in the real world, overlaying digital content onto them. This enhances the user's interaction with their environment by providing additional information and interactive elements directly tied to physical images.
5. RESTful API – Titouan BENOIT
A Web service is a service offered by an electronic device to another one,
communicating with each other via the World wide web
– 2002: W3C Web Services Architecture Working Group
• SOAP (Simple Object Access Protocol)
• HTTP
• XML Serialization
– 2004: two major classes of Web services:
• REST-compliant Web services
• Arbitrary Web services
A software system designed to support interoperable machine-to-
machine interaction over a network
1. Introduction
RESTful API - v1.0 5
7. RESTful API – Titouan BENOIT
Representational State Transfer (REST)
– Software architectural style
– Communicate over (not always) HTTP(S)
– With HTTP verbs (GET, POST, PUT, DELETE, etc.)
– Web resources identified by Uniform Resource Identifiers (URIs)
– CRUD (Create, Read, Update, Delete)
– Examples:
• GET http://myapi.domain.com/resources/2
• DELETE http://myapi.domain.com/resources/3
• GET http://myapi.domain.com/resources
REST was defined by Roy Thomas Fielding in his 2000 PhD dissertation "Architectural Styles and the
Design of Network-based Software Architectures"
RESTful API - v1.0 7
2. RESTful API
9. RESTful API – Titouan BENOIT
RESTful API - v1.0 9
3. HTTP(S) Request
HTTP Verbs URI Action Description
GET api/resources getResourcesAction Retrieve all resources
GET api/resources/2 getResourceAction(id) Retrieve resource id 2
POST api/resources postResourcesAction(Request) Create a new resource
PATCH api/resources/1 patchResourcesAction(Request,id) Edit resource id 1
PUT api/resources/1 putResourcesAction(Request,id) Edit resource id 1
DELETE api/resources/3 deleteResourcesAction(id) Delete resource id 3
10. RESTful API – Titouan BENOIT
RESTful API - v1.0 10
3. HTTP(S) Request - Filters
Filters
– Filters and sorting on resources
• https://api.example.com/resources?filters=type1&sort=asc
– Only use URL parameters (GET vars) for filtering and sorting
15. RESTful API – Titouan BENOIT
Authentification
– No Auth
– Basic Auth
– Digest Auth
– OAuth 1.0
– Oauth 2.0
– AWS Signature
– …
We will see…
– Basic Auth
– Oauth 2.0
RESTful API - v1.0 15
5. Authentification
16. RESTful API – Titouan BENOIT
Basic Auth
– In request headers
• "Authorization": "Basic " + api_key
• api_key = btoa(username + ":" + password);
• Base64 encoding/decoding
Security note
– Server needs SSL layer! (http(s))
– Security is managed by the server
• Firewall
• User validation
• Response
• …
RESTful API - v1.0 16
5. Authentification – Basic Auth
JavaScript Example
HTTP Request
17. RESTful API – Titouan BENOIT
OAuth 2.0
Roles
– resource owner: generally yourself, the data owner
– resource server: server which hosts data
– client (application): an application which asks for data to the resource server
– authorization server: deliver tokens, this server can be the same as the resource
server
Tokens
– access_token
– refresh_token
Security note
– HTTPS ONLY!
RESTful API - v1.0 17
5. Authentification – OAuth 2.0 – 1/9
18. RESTful API – Titouan BENOIT
Client registration (on authorization server)
– Application Name
– Redirect URLs
– Grant Type(s)
– Example with Symfony2 as an OAuth2 server (FOSOAuthServerBundle):
• php app/console welp:oauth-server:client:create --redirect-uri="CLIENT_HOST" --grant-
type="authorization_code" --grant-type="password" --grant-type="refresh-token" --grant-
type="token" --grant-type="client_credentials"
– Response from the server:
• Client Id
• Client Secret
– RFC 6749 — Client Registration
RESTful API - v1.0 18
5. Authentification – OAuth 2.0 – 2/9
19. RESTful API – Titouan BENOIT
Grant Types
– Authorization Code Grant (authorization_code)
– Implicit Grant
– Resource Owner Password Credentials (password)
– Client Credentials (client_credentials)
RESTful API - v1.0 19
5. Authentification – OAuth 2.0 – 3/9
20. RESTful API – Titouan BENOIT
Authorization Code Grant (authorization_code)
RESTful API - v1.0 20
5. Authentification – OAuth 2.0 – 4/9
21. RESTful API – Titouan BENOIT
Implicit Grant (less secure)
RESTful API - v1.0 21
5. Authentification – OAuth 2.0 – 5/9
1. The client (JS App) wants to access to your
Facebook profil
2. You are redirected to the Facebook
authorization server.
3. If you autorized access, the authorization
server redirects you to the JS web app et
expose the token access in the url
throught a callback. Callback example:
http://example.com/oauthcallback#access
_token=MzJmNDc3M2VjMmQzN.
4. You can access to the Facebook API via
JavaScript with this access token (For
example:
https://graph.facebook.com/me?access_t
oken=MzJmNDc3M2VjMmQzN).
22. RESTful API – Titouan BENOIT
Resource Owner Password Credentials (password)
RESTful API - v1.0 22
5. Authentification – OAuth 2.0 – 6/9
We will
use this
23. RESTful API – Titouan BENOIT
Client Credentials (client_credentials)
RESTful API - v1.0 23
5. Authentification – OAuth 2.0 – 7/9
Here, the client application needs a
tierce service without a specific user
account.
For example, our application calls to
geoip API and it is authenticated via its
client credentials in order to access to
the service.
24. RESTful API – Titouan BENOIT
Use the access token
– Request parameters:
https://api.example.com/resources?access_token=MzJmNDc3M2VjMmQzN
– Header Authorization:
• GET /resources HTTP/1.1
Host: api.example.com
Authorization: Bearer MzJmNDc3M2VjMmQzN
RESTful API - v1.0 24
5. Authentification – OAuth 2.0 – 8/9
27. RESTful API – Titouan BENOIT
Guidelines
– 1°: URI as resources identifier
– 2°: HTTP verbs as operator identifier
– 3°: HTTP response as resources representation
– 4°: Authentification with a token
– 5°: Security = https
RESTful API - v1.0 27
6. Guidelines – 1/6
28. RESTful API – Titouan BENOIT
1°: URI as resources identifier
– List of resources
• NOK: https://api.example.com/resource
• OK: https://api.example.com/resources
– Filters and sorting on resources
• NOK: https://api.example.com/resources/filters/type1/sort/asc
• OK: https://api.example.com/resources?filters=type1&sort=asc
– Get a specific resource (id=5)
• NOK: https://api.example.com/resource/display/5
• OK: https://api.example.com/resources/5
– Get childs (relation) of a specific resource (id=5)
• NOK: https://api.example.com/resources/childs/5
• OK: https://api.example.com/resources/5/childs
– Get a specific child (id=46) (relation) of a specific resource (id=5)
• NOK: https://api.example.com/resources/childs/5/46
• OK: https://api.example.com/resources/5/childs/46
RESTful API - v1.0 28
6. Guidelines – 2/6
29. RESTful API – Titouan BENOIT
2°: HTTP verbs as operator identifier
– CRUD => POST: Create | GET: Read | PUT/PATCH: Update | DELETE: Delete
– Create a resource
• NOK: GET https://api.example.com/resources/create
• OK: POST https://api.example.com/resources
– Read/Get resource
• NOK: GET https://api.example.com/resources/display/98
• OK: GET https://api.example.com/resources/98
– Update resource
• NOK: POST https://api.example.com/resources/update/98
• OK: PUT https://api.example.com/resources/98
• OK: PATCH https://api.example.com/resources/98
– Delete resource
• NOK: GET https://api.example.com/resources/delete/98
• OK: DELETE https://api.example.com/resources/98
RESTful API - v1.0 29
6. Guidelines – 3/6
30. RESTful API – Titouan BENOIT
3°: HTTP response as resources representation
– HTTP response:
• HTTP code status
– 2xx
– 4xx
– 5xx
• Data structure
– JSON
– XML
– (HTML, CSV, …) less used
– Data response represents the resource
RESTful API - v1.0 30
6. Guidelines – 4/6
31. RESTful API – Titouan BENOIT
4°: Authentification with a token
– Basic Auth
• api_token = btoa(username + ":" + password);
• In request Header "Authorization": "Basic " + api_token
– OAuth2.0
• Request parameters:
https://api.example.com/resources?access_token=MzJmNDc3M2VjMmQzN
• Header Authorization:
– GET /resources HTTP/1.1
Host: api.example.com
Authorization: Bearer MzJmNDc3M2VjMmQzN
RESTful API - v1.0 31
6. Guidelines – 5/6
32. RESTful API – Titouan BENOIT
5°: Security = https
– TLS/SSL layer + tierce certificate
• Encrypt data transmission
– Avoid leaks and attacks such as:
• Man in the middle
• Stealing packet and token
• …
RESTful API - v1.0 32
6. Guidelines – 6/6
37. RESTful API – Titouan BENOIT
Twitter REST APIs
– https://dev.twitter.com/rest/public
– Create a new App (https://apps.twitter.com/)
– Get Access Token
– Use the API!
RESTful API - v1.0 37
8. Examples – 1/6
HTTPS
HTTPS
38. RESTful API – Titouan BENOIT
Twitter REST APIs
– Using POSTMAN:
– [French] Nice PHP use case:
http://www.grafikart.fr/tutoriels/php/twitter-api-tweets-100
RESTful API - v1.0 38
8. Examples – 2/6
39. RESTful API – Titouan BENOIT
JSONPlaceholder
– http://jsonplaceholder.typicode.com/
– Fake Online REST API for Testing and Prototyping
– OpenSource:
• https://github.com/typicode/json-server
RESTful API - v1.0 39
8. Examples – 3/6
40. RESTful API – Titouan BENOIT
PublicAPIs
• https://www.publicapis.com/
• Web APIs directory (not all APIs are RESTful)
• You can add your API
RESTful API - v1.0 40
8. Examples – 4/6
41. RESTful API – Titouan BENOIT
Laravel REST API example
– https://github.com/Nightbr/jdn2014
– Basic Auth
– Request examples:
RESTful API - v1.0 41
8. Examples – 5/6
42. RESTful API – Titouan BENOIT
Symfony REST API example
– http://git.nbcorp.fr/oha/oha-api
– Basic Auth
– Using:
• FosRestBundle
• NelmioApiDoc
– Full project: http://blog.nbcorp.fr/2015/02/oha-open-home-
automation/
RESTful API - v1.0 42
8. Examples – 6/6
44. RESTful API – Titouan BENOIT
REST API with Laravel
– https://github.com/Nightbr/jdn2014/tree/master/app/api/laravel
– Routing (app/routes.php) [security Basic Auth]
RESTful API - v1.0 44
9. Development – Laravel - 1/6
45. RESTful API – Titouan BENOIT
REST API with Laravel
– Security Basic Auth (app/filters.php)
RESTful API - v1.0 45
9. Development – Laravel - 2/6
46. RESTful API – Titouan BENOIT
REST API with Laravel
– https://laravel.com/docs/5.1/controllers#restful-resource-controllers
– REST Controller (app/controllers/CategorieController.php)
RESTful API - v1.0 46
9. Development – Laravel - 3/6
47. RESTful API – Titouan BENOIT
REST API with Laravel
– REST Controller (app/controllers/CategorieController.php)
RESTful API - v1.0 47
9. Development – Laravel - 4/6
Exposed routes:
48. RESTful API – Titouan BENOIT
RESTful API - v1.0 48
9. Development – Laravel - 5/6
REST API with Laravel
– Laravel tips:
– View all app route:
• php artisan route
– Create database schema:
• php artisan migrate
– Add fixtures to database
• php artisan db:seed
– A nice admin panel for Laravel:
• http://administrator.frozennode.com/
– [French] REST API tutoriel with Laravel:
• http://www.grafikart.fr/tutoriels/php/rest-503
Laravel Administrator
49. RESTful API – Titouan BENOIT
RESTful API - v1.0 49
9. Development – Laravel - 6/6
REST API with Laravel
– Conclusion
• Lightweight RESTful API
• Very quick setup (2-4 hours max)
• Laravel framework (composer, artisan, …)
• Basic API
50. RESTful API – Titouan BENOIT
RESTful API - v1.0 50
9. Development – Symfony- 1/13
REST API with Symfony
– Usefull bundles
• FosRestBundle: https://github.com/FriendsOfSymfony/FOSRestBundle
• NelmioApiDoc: https://github.com/nelmio/NelmioApiDocBundle
– Based on http://swagger.io/
51. RESTful API – Titouan BENOIT
RESTful API - v1.0 51
9. Development – Symfony- 2/13
FosRestBundle
• Setup
– Install the bundle
» composer require friendsofsymfony/rest-bundle
– Enable the bundle
» app/AppKernel.php
» new FOSRestBundleFOSRestBundle(),
– Enable a Serializer
» JMSSerializerBundle
» composer require jms/serializer-bundle
» Register it in app/AppKernel.php
» new JMSSerializerBundleJMSSerializerBundle(),
52. RESTful API – Titouan BENOIT
RESTful API - v1.0 52
9. Development – Symfony- 3/13
FosRestBundle
– Configuration (app/config/config.yml)
– Routing (routing.yml)
– Routing (annotation in controller)
• use FOSRestBundleControllerAnnotations as Rest;
• * @RestGet("/needs/{id}/messages", requirements={"id": "d+"}, defaults={"_format":
"json"})
– Controller extends FOSRestController
53. RESTful API – Titouan BENOIT
RESTful API - v1.0 53
9. Development – Symfony- 4/13
FosRestBundle
– REST Controller: method
• getClientsAction() -> GET api.domain.com/v1/clients
• getClientAction($id) -> GET api.domain.com/v1/clients/{id}
• postClientsAction(Request $request) -> POST api.domain.com/v1/clients
• patchClientsAction(Request $request, $id) -> PATCH api.domain.com/v1/clients/{id}
• deleteClientsAction($id) -> DELETE api.domain.com/v1/clients/{id}
– Tips:
• use FOSRestBundleControllerAnnotations as Rest;
• In method annotation:
– * @RestView
– * @RestView(serializerEnableMaxDepthChecks=true)
54. RESTful API – Titouan BENOIT
RESTful API - v1.0 54
9. Development – Symfony- 5/13
FosRestBundle
use SensioBundleFrameworkExtraBundleConfigurationSecurity;
We use FosUserBundle to manage users, here is a constraint on user
Role. It is natively managed by Symfony Security Component
http://symfony.com/doc/current/book/security.html
Enable MaxDepthChecks of the Serializer is a necessary
optimisation for huge database. For example, if my client has
Many Testbenches and TestBench has modules and also clients, I
would like to retrieve only client’s Testbenches with my client
but no more than this. So in Entity/Client.php:
See NelmioApiDoc
55. RESTful API – Titouan BENOIT
RESTful API - v1.0 55
9. Development – Symfony- 6/13
FosRestBundle
56. RESTful API – Titouan BENOIT
RESTful API - v1.0 56
9. Development – Symfony- 7/13
FosRestBundle
57. RESTful API – Titouan BENOIT
RESTful API - v1.0 57
9. Development – Symfony- 8/13
FosRestBundle
– Filtering & sorting
• Use ParamFetcher
– use FOSRestBundleRequestParamFetcher;
• And QueryParam annotation:
– * @RestQueryParam(name=“limit", nullable=true)
– * @QueryParam(name=“sort", nullable=true, description=“asc/desc")
• And the controller: public function getTaskAction(ParamFetcher $paramFetcher)
{
foreach ($paramFetcher->all() as $criterionName => $criterionValue) {
// some logic here, eg building query
}
$results = // query database using criteria from above
// this is just a simple example how to return data
return new JsonResponse($results);
}
58. RESTful API – Titouan BENOIT
RESTful API - v1.0 58
9. Development – Symfony- 9/13
FosRestBundle
– Usefull links:
• http://symfony.com/doc/current/bundles/FOSRestBundle/index.html
• http://jmsyst.com/bundles/JMSSerializerBundle
• Add extra fields using JMSSerializer:
http://stackoverflow.com/questions/15007281/add-extra-fields-using-jms-
serializer-bundle
59. RESTful API – Titouan BENOIT
RESTful API - v1.0 59
9. Development – Symfony- 10/13
NelmioApiDoc
60. RESTful API – Titouan BENOIT
RESTful API - v1.0 60
9. Development – Symfony- 11/13
NelmioApiDoc
61. RESTful API – Titouan BENOIT
RESTful API - v1.0 61
9. Development – Symfony- 12/13
NelmioApiDoc
– composer require nelmio/api-doc-bundle
– Register the bundle in app/AppKernel.php
• new NelmioApiDocBundleNelmioApiDocBundle(),
– routing.yml
– app/config/config.yml
62. RESTful API – Titouan BENOIT
RESTful API - v1.0 62
9. Development – Symfony- 13/13
NelmioApiDoc
– In controller:
• use NelmioApiDocBundleAnnotationApiDoc;
• And add annotation to method:
– API Documention
• http://myapp/api/doc
• php app/console api:doc:dump --format=html > api.html --no-sandbox
– https://github.com/nelmio/NelmioApiDocBundle/blob/master/Resources/doc/index.md
64. RESTful API – Titouan BENOIT
RESTful API - v1.0 64
10. CORS – 1/3
CORS: CROSS-ORIGIN RESOURCE SHARING
– Cross-Origin Resource Sharing (CORS) is a specification that
enables truly open access across domain-boundaries. If you serve
public content, please consider using CORS to open it up for
universal JavaScript/browser access.
– http://enable-cors.org/index.html
– http://www.html5rocks.com/static/images/cors_server_flowchart
.png
65. RESTful API – Titouan BENOIT
RESTful API - v1.0 65
10. CORS – 2/3
CORS: CROSS-ORIGIN RESOURCE SHARING
– Server Side: CORS on PHP
– Client Side:
66. RESTful API – Titouan BENOIT
RESTful API - v1.0 66
10. CORS – 3/3
CORS: NelmioCorsBundle for Symfony2
– https://github.com/nelmio/NelmioCorsBundle
• Handles CORS preflight OPTIONS requests
• Adds CORS headers to your responses
– composer require nelmio/cors-bundle
– Register bundle
• new NelmioCorsBundleNelmioCorsBundle(),
– app/config/config.yml ->