ctechhindi / CodeIgniter-API-Controller

CodeIgniter Restful API Controller - Easily build REST API with Token Authorization
MIT License
67 stars 50 forks source link

getting 500 error on live server #5

Closed alphanso-dev closed 5 years ago

alphanso-dev commented 5 years ago

hi,

CodeIgniter-API-Controller is working on my local system is properly but on my live server, it's getting 500 erro on response function, i comment "header(self::HEADER_STATUS_STRINGS[$http_code], true, $http_code);" this on live it's working but auth can't set.

jeevan-lal commented 5 years ago

Please show me your source code.

Pablo-DiazTassara commented 4 years ago

Hi, did you find a solution for this problem? that happens to me too. Returns a 500.

sdfarshid commented 4 months ago

You must Change the code the header Status Strings with this

const HEADER_STATUS_STRINGS = [
    '405' => 'HTTP/1.1 405 Method Not Allowed',
    '400' => 'BAD REQUEST',
    '408' => 'Request Timeout',
    '404' => 'NOT FOUND',
    '402' => 'BAD PARAM',
    '422' => 'BAD PARAM',
    '401' => 'UNAUTHORIZED',
    '200' => 'OK',
];

const HEADER_STATUS_STRINGS = [
    '405' => 'HTTP/1.1 405 Method Not Allowed',
    '400' => 'HTTP/1.1 400 Bad Request',
    '408' => 'HTTP/1.1 408 Request Timeout',
    '404' => 'HTTP/1.1 404 Not Found',
    '402' => 'HTTP/1.1 402 Payment Required',
    '422' => 'HTTP/1.1 422 Unprocessable Entity',
    '401' => 'HTTP/1.1 401 Unauthorized',
    '200' => 'HTTP/1.1 200 OK',
];