POSTing to CodeIgniter API |
Hey Guys,
I'm working with a codeigniter website with API and for some reason I am unable to get server-side content from POST requests. Here is some code samples of the API. Everything works fine when POSTing from the website to the server, but via a service like POSTman I cannot seem to view data as I normally would aka $this->input->post('my_field') https://gist.github.com/simistern/6af216...81dd050745 https://gist.github.com/simistern/063d3e...101ee33781 Any help would be greatly appreciated!
judging from the way you code your PHP script,
you're doing it wrong. you couldn't just catch a value from a function that doesn't have any 'return' words. and the way you put your 'return' r-word from the index clearly indicates that you needs to understand the way how a simple 'functional' (or a little OOP) works. here's a resource that might help on understanding how function works. https://www.kidscodecs.com/programming-functions/ and here's also a little insight about how OOP works in PHP. probably not the best tutorial, but it should do: https://www.tutorialspoint.com/php/php_o...iented.htm |
Welcome Guest, Not a member yet? Register Sign In |