Welcome Guest, Not a member yet? Register   Sign In
Why RESTful?
#1

Hi All,
I'm use CI4 to build Web server for App Mobile.
WebServer return result for App Mobile as My Format Json String.
I have learned about "RESTful Resource Handling", I don't understant the difference between My Format Json String vs result RESTful.
What is Benefits of RESTful Resource Handling? Hope everyone can explain and show the best way to apply.
Thanks All,
Reply
#2

1 Rest ful reaponse is json object

2 restful controller input data could be formdata or json object

3 restful methods get put post delete
Enlightenment  Is  Freedom
Reply
#3

(09-10-2021, 02:28 AM)paliz Wrote: 1 Rest ful reaponse is json object

2 restful  controller input data could be formdata or json object

3 restful methods get put post delete

Thanks your Feedback,

Current, In Controller, I use template from FuntionHelper to reaponse json object with my format json, apply all controllers. 

My format json same as: 
Code:
{"Status":200,"Msg":"Connected","Data":{"List":[],"Type":"Export"}}


I don't understant, different between my way vs RESTful (ci4 supports).

To return json results for Mobile App, Which solution should I apply?
Reply
#4

restful reaponse check by status code if 200 means ok

Body could be any thing usellay data=> is return

When error happen for exmple status code 400 means conflict

Reponse body has error=> object




Thats all
Enlightenment  Is  Freedom
Reply




Theme © iAndrew 2016 - Forum software by © MyBB