RESTful web services using Slim PHP Framework

| Last Updated: | In: Core php, Freebies


Slim

In this article we’ve discussed creating a RESTful web service using the Slim framework. Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

API Router
The Slim Framework helps you map resource URIs to callback functions for specific HTTP request methods (e.g. GET, POST, PUT, DELETE, OPTIONS or HEAD). A Slim application will invoke the first route that matches the current HTTP request’s URI and method.

Middleware
Build your application with custom concentric middleware to tweak the HTTP request and response objects before and after your Slim app runs.

HTTP Request
Slim has easy-to-use request and response abstractions that let you inspect and manipulate HTTP messages’ method, status, URI, headers, cookies, and body.

Sessions
Slim provides first-class session support. It persists session data using industry standard encryption. Slim also enables “flash” messages across requests.

Caching
Slim provides helper methods that make client-side HTTP caching easier. It helps you work with the Expires, Last-Modified, and ETag headers.

Crypto
Slim has super-secure cryptography using military-grade encryption. Slim uses your unique key to encrypt session and cookie data before persisting data to disk.

An example to print Hello to Slim World

Tags: , , ,


About: Prem Tiwari

Prem Tiwari is founder of freewebmentor.com and Software developer from New Delhi (India). Follow Prem's development codes on facebook, and make sure you check out freewebmentor.com for the latest in web development related Tips with the complete code.


You may also like:

Follow us!

Get Free Access of 350+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW