manuelgil / rest-api-with-slim-php Goto Github PK
View Code? Open in Web Editor NEWREST API with PHP Slim Framework 3 and MySQL
License: MIT License
REST API with PHP Slim Framework 3 and MySQL
License: MIT License
Hi,
First of all thank you for creating this clean starter project. I was experimenting with it, I installed and setup as per the instruction.
Currently when I hit an api lets say GET to http://localhost/REST-api-with-slim-PHP/public/webresources/mobile_app/ping
It send me response back pong
which is correct.
But could you provide me example for LOGIN and REGISTER ?
I assume that for LOGIN it would be http://localhost/REST-api-with-slim-PHP/public/webresources/mobile_app/login/testUser/testPwd
(without Bearer token)
I am getting blank response for above hit. Could you suggest me where I am doing wrong?
I have followed you advice given that is composer require slim/slim "^3.0"
Now when I go it create a folder called vendor and in it is slim with many slims folder like this /var/www/html/vendor/slim/slim/Slim so where to copy your codes ? Please advice ?
Hi
How is it going?
Any thoughts on updating to slim 4?
So, I hope you are always healthy and happy.
Hi and thanks for the starter API.
I was able to register a new user and log in. I'm trying to GET lists but it's returning a 500 error. Here's the RAW response. Can you have a look?
Thanks!
HTTP GET http://domain/webresources/mobile_app/list/
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWFkZXIiOnsiaWQiOiIzIiwidXNlciI6InRlc3RfdXNlciJ9LCJwYXlsb2FkIjp7ImlhdCI6IjIwMTgtMDQtMDYgMDE6NDY6MTkiLCJleHAiOiIyMDE4LTA0LTA2IDAzOjQ2OjE5In19.Wi31CNlssEg7bv0xAqJ7KMYUcONbGc-lbnBHb4VKKMQ
Host: domain
500 Internal Server Error
date: Fri, 06 Apr 2018 01:46:34 GMT
server: Apache/2.4.29 (Unix) PHP/7.1.14
connection: close
x-powered-by: PHP/7.1.14
content-length: 445
content-type: text/html;charset=UTF-8
<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'><title>Slim Application Error</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>Slim Application Error</h1><p>A website error has occurred. Sorry for the temporary inconvenience.</p></body></html>
Hi.
When I run http: // localhost / public / webresources / mobile_app / verify, the result of "200 OK" is displayed in RestEasy.
However, when running in postman, the status is "401 Unauthorized".
What did I do wrong in postman?
please answer about my question.
Thank you :)
GET: http: // localhost / public / webResources / mobile_app / verify
Authorization
TYPE: BearerToken
Token: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWFkZXIiOnsiaWQiOjEsInVzZXIiOiJ0ZXN0VXNlciJ9LCJwYXlsb2FkIjp7ImlhdCI6IjIwMTktMDEtMDEgMDA6MDA6MDAiLCJleHAiOiIyMDIwLTAxLTAxIDAwOjAwOjAwIn19.RTTPlUqE - WMP9M28-oj7p8MhWdisuuhWBsioDa_bgY
Hi.
Thanks for the these API. It's pretty code.
Btw, i want to know how to create unit test for it.
Could you create the unit test for these apis?
Thanks again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.