Skip to content

This project focuses on developing a REST API using PHP to facilitate seamless communication and data exchange between client applications and the server.

Notifications You must be signed in to change notification settings

tolgahanacar/php-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

php-rest-api

PHP Rest(Restful) API

Database structure

id username first_name last_name email updateDate createDate
int [AUTO_INCREMENT] varchar(60) varchar(50) varchar(50) varchar(60) TIMESTAMP [CURRENT_TIMESTAMP] TIMESTAMP

request.rest

// GET Method

GET http://localhost/rest-api/index.php HTTP/1.1

// Single GET Method

GET http://localhost/rest-api/index.php?id=101 HTTP/1.1

// POST Method

POST http://localhost/rest-api/index.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded

username=tolgahan01
&first_name=tolgahan
&last_name=acar
&email=tolga@tolgahanacar.net

// DELETE Method

DELETE http://localhost/rest-api/index.php?id=102 HTTP/1.1

# // PUT Method

PUT http://localhost/rest-api/index.php HTTP/1.1
content-type: application/json

{
"id": 101,
"username": "tolgahan02",
"first_name": "tolgahan",
"last_name": "acar",
"email": "info@tolgahanacar.net"
}

Postman

Request Params Query form-data x-www-form-urlencoded
GET id=1 http://localhost/rest-api/index.php x x
POST x http://localhost/rest-api/index.php username=tolgahan x
PUT x http://localhost/rest-api/index.php x {"id":1, "username":"tolgahan0"}
DELETE id=100 http://localhost/rest-api/index.php x x

About

This project focuses on developing a REST API using PHP to facilitate seamless communication and data exchange between client applications and the server.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages