 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Lorna Mitchell's Blog: Building A RESTful PHP Server Routing the Request
by Chris Cornutt January 23, 2012 @ 11:14:11
Lorna Mitchell is back with a second installment in her "Building a RESTful PHP Server" series with this new post about handling and routing the incoming requests. (You can find the first part about working with the request here)
This is the second part of a series, showing how you might write a RESTful API using PHP. This part covers the routing, autoloading, and controller code for the service, and follows on from the first installment which showed how to parse the incoming request to get all the information you need.
She shows how to grab the controller name from the incoming request (based on her previous code), create the object for it and execute the requested action name. Also included is a sample autoloader and a basic controller - a UsersController with "getAction" and "postAction"
methods for responding to GET and POST requests.
voice your opinion now!
restful server tutorial request routing controller get post action
Lorna Mitchell's Blog: POSTing JSON Data With PHP cURL
by Chris Cornutt November 22, 2011 @ 18:06:48
On her blog today Lorna Mitchell has a quick tip for anyone having an issue sending POSTed JSON data with the curl functionality that can be built into PHP. The trick to her method is sending things with the right header.
We can't send post fields, because we want to send JSON, not pretend to be a form (the merits of an API which accepts POST requests with data in form-format is an interesting debate). Instead, we create the correct JSON data, set that as the body of the POST request, and also set the headers correctly so that the server that receives this request will understand what we sent.
She includes a code example (about ten lines) showing the POSTing process that sets up options using curl's curl_setopt. Be sure to set up the headers to send as "application/json" - that's the trick to letting the remote end know the format.
voice your opinion now!
post data tutorial json curl curlsetopt
Chris Hartjes' Blog: Testing Form Posts in Zend Framework
by Chris Cornutt September 23, 2010 @ 10:36:42
In a new post to his blog today Chris Hartjes talks about the trials and tribulations he had when trying to test POST requests in his Zend Framework application with Zend_Test/PHPUnit.
I had done a refactoring of the way a model was pulling in stats for running backs and receivers for a fantasy game. As a result, in production (you suck Chris) you could not see results for those players. The data was there, I had not properly tested things. A familiar situation. So, I fixed the code and wrote my more-specific-than-before unit tests, but I decided I also wanted to make sure that the output on the page itself worked correctly. This began the descent into madness.
He found several examples of ways to test POST requests but none of them worked in his situation. They used an object chaining method that just didn't cooperate for him, so he figured out another way. The code for it's included in the post - it uses the getRequest method to set up and send the POST request.
voice your opinion now!
zendframework post request getrequest unittest zendtest phpunit
Sameer Borate's Blog: Raw vs. cooked PHP $_POST variables
by Chris Cornutt September 20, 2010 @ 10:15:16
Sameer Borate as a new post to his blog today looking at some of the quirks he's found when dealing with the $_POST superglobal in PHP.
A little quirk of PHP $_POST var I encountered while fixing a Salesforce web-to-Lead bug. A Wordpress site was using a form to submit user requests to the Salesforce web-service. The form that submitted the data had the following fields along with the others. The problem was with the multi-select field, only the last value selected in the multi-select was getting captured.
He investigated and found that his code was echoing out all of the values, but wasn't using the "field_name[]" notation with the square brackets to send back multiple values to PHP. Changing this and trying again, he noticed it still wasn't working as expected (with Salesforce). He figured out they're using "raw" versus "cooked" handling of the POSTed variables. Check out the rest of his post to find out what that means.
voice your opinion now!
post variable raw cooked salesforce handling
Lorna Mitchell's Blog: Three Ways to Make a POST Request from PHP
by Chris Cornutt January 19, 2010 @ 08:45:33
Lorna Mitchell has a new post to her blog looking at three different ways you can make a POST request to a server - cURL, Pecl_Http non-OOP and Pecl_Http with the OOP interface.
I've been doing a lot of work with services and working with them in various ways from PHP. There are a few different ways to do this, PHP has a curl extension which is useful, and if you can add PECL extensions then pecl_http is a better bet but there are a couple of different ways of using it. This post shows all these side-by-side.
Code snippets are included for each showing a request to the Flickr API. Be sure to check out the post's comments for more great ideas (like streams, the PEAR HTTP_Client package, Zend_Http_Client and other request types without cURL).
voice your opinion now!
post request curl pecl tutorial
Job Posting: Doubledot Media Limited Seeks CakePHP Developer (Christchurch, Canterbury, New Zealand)
by Chris Cornutt June 16, 2009 @ 10:25:04
| Company |
Doubledot Media Limited |
| Location |
Christchurch, Canterbury (New Zealand) |
| Title |
CakePHP Developer |
| Summary |
We are seeking a motivated and creative developer with a passion for transforming cutting edge technologies into innovative, real-world applications. The successful applicant will have a solid understanding of PHP and PHP frameworks and be an enthusiastic follower of current and emerging web technologies.
A strong understanding of PHP, JS, HTML, CSS and database technology is essential, as is a flair for providing solid programming with feature-rich interfaces focused on customer usability.
What will you be doing?
You will be creating, improving and adding new functionality to our entire network of software applications as well as being involved in..
- Improvements to our core frameworks and backend systems.
- Suggesting and developing solutions to improve our software's performance.
- Adding additional functionality to our hugely popular software tools.
- Sharing your thoughts and give input to the direction our software development heads.
No day is like the previous so be prepared for a changing environment!
Essential skills and abilities
- PHP - 2+ years commercial experience
- PHP Frameworks
- Javascript Frameworks
- Solid understanding of HTML and CSS
- Experience with at least one content management, wiki, or blogging system.
- Understanding of OOP principles in PHP5
- Using version control software
- Knowledge of mod_rewrite in Apache
- Knowledge of http fundamentals (request, response headers)
This is a great opportunity to really show your coding skills and play your part in some pretty cool projects. You'll also get to work in a relaxed, creative environment with a young and amusing team.
If you think you've got the "spark" we're after...and have the skills to match then we want to hear from you.
This position is full time and based in Christchurch, New Zealand.
About Doubledot Media
Doubledot Media is a premier web development company, responsible for the development of some of the leading B2B websites around the world.
Our websites are developed primarily on a cake framework and use a wide range of technologies including php, ajax and mootools. Our databases run on MySQL and Linux Servers which are hosted with Rackspace and ServerBeach.
Interested in this position?
Send your Portfolio, CV and Cover Letter to jobs@doubledotmedia.com. In your cover letter please explain why we should hire you and your 3 highest achievements / developments on the web.
|
| Link |
More Information |
voice your opinion now!
job post newzealand doubledot media cakephp
Ian Selby's Blog: Making RESTful Requests in PHP
by Chris Cornutt May 15, 2009 @ 07:57:19
In a new post to his blog Ian Selby looks at working with REST requests in PHP. He includes some of the basics of REST too, for those not completely familiar with the term.
APIs have become a very commonplace part of many popular web sites and services...especially REST APIs. I've already discussed how you can roll your own REST API for your PHP apps, but I've also received countless requests to go over how to actually make RESTful requests. That's exactly what we'll take a look at in this article
His tool of choice is the curl extension, making it simple to create a class wrapper with methods like executePost, executeGet, setAuth and, of course, execute. He outlines the class and gives the code blocks that fit inside each of the major functions. In the end you'll have a class that can make GET, POST, PUT and DELETE requests and be able to correctly parse the response.
voice your opinion now!
delete post put get tutorial request rest
|
Community Events
Don't see your event here? Let us know!
|