[go: up one dir, main page]

Skip to content

fits91/php_simple_rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

php_simple_rest

Simple REST API using php

Get info:

Request

GET /api.php?date=2020-05-14

param 'date' is date in format Y-m-d if absent date equal today

Response

{
"result": [
    {
        "id": "6",
        "source_id": "1",
        "date": "2020-05-14",
        "json_data": "{}",
    {
        "id": "7",
        "source_id": "1",
        "date": "2020-05-14",
        "json_data": "{}"
    },
    {
        "id": "8",
        "source_id": "1",
        "date": "2020-05-14",
        "json_data": "{}"
    },
    {
        "id": "9",
        "source_id": "1",
        "date": "2020-05-14",
        "json_data": "{"}"
    },
    {
        "id": "10",
        "source_id": "1",
        "date": "2020-05-14",
        "json_data": ""}"
    }
] }

Save info:

Request

POST /api.php
Content-Type: application/json
{
	"data":"some data"
}

Response

{"result": "data inserted"}
or
{"result": "source not found"}

Releases

No releases published

Packages

No packages published