codeigniter-restserver | fully RESTful server implementation for CodeIgniter | Web Framework library
kandi X-RAY | codeigniter-restserver Summary
kandi X-RAY | codeigniter-restserver Summary
A fully RESTful server implementation for CodeIgniter using one library, one config file and one controller.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Check the auth override
- Respond to an object .
- Check the limit
- Output the response
- Perform LDAP authentication .
- Convert data to a CSV string
- Convert to XML
- Convert data to HTML
- Convert data to JSON
- Convert to array
codeigniter-restserver Key Features
codeigniter-restserver Examples and Code Snippets
Community Discussions
Trending Discussions on codeigniter-restserver
QUESTION
I'm having a problem with the popular REST API codeigniter maintained by Chris Kacerguis.I created a Datadiri controller that looks like this:
...ANSWER
Answered 2017-Jan-06 at 04:10Lets try as below....
QUESTION
I have implemented a dynamic routing system to my Codeigniter from the database. while am loading the routes dynamically it is showing me an internal server error 500. I have already implemented in my other projects also but it's not possible here. I am using Codeigniter https://github.com/chriskacerguis/codeigniter-restserver
...ANSWER
Answered 2019-Mar-24 at 13:59You have missed the bracket for the regexp
match. i.e the :any
should be like (:any)
. Update the route like below and try.
QUESTION
I am using codeigniter rest server. I can't have a validation with GET request parameters. this is my validation code:
...ANSWER
Answered 2019-Mar-12 at 19:42$config = [
[
'field' => 'username',
'label' => 'Username',
'rules' => 'required|min_length[3]|alpha_dash',
'errors' => [
'required' => 'We need both username and password',
'min_length' => 'Minimum Username length is 3 characters',
'alpha_dash' => 'You can only use a-z 0-9 _ . – characters for input',
],
],
[
'field' => 'password',
'label' => 'Password',
'rules' => 'required|min_length[6]',
'errors' => [
'required' => 'You must provide a Password.',
'min_length' => 'Minimum Password length is 6 characters',
],
],
];
$data = $this->input->get();
$this->form_validation->set_data($data);
$this->form_validation->set_rules($config);
if($this->form_validation->run()==FALSE){
print_r($this->form_validation->error_array());
echo "ERROR!!";
}else{
echo "SUCCESS!!";
}
QUESTION
I am using chriskacerguis/codeigniter-restserver to create my rest api server and i am trying to enable api keys but they problem is that even though i followed the instructions,i am unable to authenticate using any key,ie all request go through even if they don't have the api key header in the request.
This is my current config
rest.php
...ANSWER
Answered 2017-Feb-21 at 02:27So I'm just a messenger, as Chris, already point out the problem is in REST_Controller.php, just add
QUESTION
I'm using REST_Controller CodeIgniter library in my project.
I have a login post method that cannot being reachable because REST_Controller is setting method as GET even if I do a POST.
Here is a snippet of my Auth.php controller:
...ANSWER
Answered 2018-May-25 at 01:13Nevermind, I got the solution!
This was happening just because I forgot to enable mod_rewrite in my Apache.
This fixes the problem:
QUESTION
My reactjs application works with api.
My api is written in php language and CodeIgniter framework.
https://github.com/chriskacerguis/codeigniter-restserver
this is my api:
...ANSWER
Answered 2018-Apr-26 at 09:28QUESTION
I am creating rest api using codeigniter, Rest Server, and firebase php-jwt . following is my code to create jwt token.
...ANSWER
Answered 2018-Feb-02 at 05:50I think you have to require_once
signature before JWT.php
QUESTION
I have to create an API (JSON REST) for a project that has recently moved onto AWS, with a PHP CodeIgniter code-base, and an RDS database.
I have a bit of a dilemma, because I'm unsure what route to take to create the API. My two options seem to be:
- Create an API with CodeIgniter Rest Server
- Use AWS, using a combination of Lambda and the API Gateway to GET and POST to my RDS database.
The paramount priority is security, so that points towards using AWS, as far as I understand, but after failing in my attempt to make a small scale mock-up on AWS, I'm left a bit confused.
I wondered if anybody had any input as this is somewhat of a niche question, and I've had no interaction with AWS or CodeIgniter Rest Server.
Thank you for your time!
...ANSWER
Answered 2018-Jan-18 at 08:59I can help you in a bit since I've experience with deploying Codeigniter base web system onto AWS.
First of all, the security in questions... AWS wont help much. Yes, it is by default have more security layer. But it is no use if your application itself is not secured.
So here goes:
- If you want to deploy fast, I'd suggest go through EC2, install one of the image that have LAMP configured (from market, should've free image that you can use)
- Upload to the server, configure the right config
- Then it should work as per what it is intended.
But if you want to utilized auto scaling features
- Setup the Elastic Beanstalk (EB) for PHP environment
- ZIP up the codeigniter source code with all setting configured as below
- Database setting point to RDS
- Session to use database driver and create the needed table in the RDS
- Upload and deploy to the EB
- Then hopefully everything is working fine
Then, if to use API Gateway & Lambda, you will actually need to learn a bit more things.
- How to configure API Gateway, to get familiar with how to use it
- How to "link" it to lambda
- How Lambda need to read request & response back etc
- Also on Lambda no PHP support yet, so need to learn nodejs/python etc in order to use it
Basically if want to use API Gateway & Lambda you might need to start the development from scratch.
QUESTION
I am trying to integrate RESTful services to my Codeigniter application. I am using this library https://github.com/chriskacerguis/codeigniter-restserver and the tutorial from https://code.tutsplus.com/tutorials/working-with-restful-services-in-codeigniter--net-8814.
However, I am a little confused about how to implement routing. The tutorial mentions using the full url but I'd like to do something like:
My Controller
class AdminLogin_WS extends REST_Controller {
...ANSWER
Answered 2017-Jul-15 at 16:53Updated with information from chat
Using login_get()
and login_post()
and then making the POST request to AdminLogin_WS/login
was the correct thing to do, and the login_post()
was getting called, there was just some confusion because the POST was returning the same response as the GET using the code that the poster was using.
Original answer
I would post this as a comment but don't have the rep to do so.
What do you mean by "It only works if I create a controller function called login_get()
"? That sounds to me like you're sending in a GET rather than a POST to your route. Can you give some information on how you're testing to see if you can POST and get to your login_post()
? Have you tried downloading a tool like Postman (https://www.getpostman.com/) and sending in a POST to help eliminate the possibility that you're not sending in the POST correctly?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install codeigniter-restserver
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page