News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Turland's Blog:
Gotcha on Scraping .NET Applications with PHP and cURL
July 01, 2010 @ 08:51:36

New on his blog today Matthew Turland has posted about a "gotcha" he came across when working with cURL to pull down information (scrape content) from a remote .NET application.

I recently wrote a PHP script to scrape data from a .NET application. In the process of developing this script, I noticed something interesting that I thought I'd share. In this case, I was using the cURL extension, but the tip isn't necessarily specific to that. One thing my script did was submit a POST request to simulate a form submission. [...] The issue I ran into had to do with a behavior of the CURLOPT_POSTFIELDS setting that's easy to overlook.

The problem was something cURL does automatically - change the header for the content type because you're sending an array. Thankfully, with the help of a call to http_build_query to encode it correctly, the request will use the right headers.

0 comments voice your opinion now!
net application scrape content gotcha curl


blog comments powered by Disqus

Similar Posts

php|architect: Application-level Logging with the Zend Framework

Developer Tutorials Blog: Parallel web scraping in PHP: cURL multi functions

Chris Jones: Excitement! Updated Underground PHP and Oracle Manual is Available for Download

PRADO Watch Blog: PRADO Watch: Interview With Timani Tunduwani - Why I Moved From CakePHP to PRADO

Padraic Brady's Blog: Nanosecond Scale Remote Timing Attacks On PHP Apps: Take Them Seriously?


Community Events





Don't see your event here?
Let us know!


development series community podcast threedevsandamaybe interview code conference tips application list introduction zendserver release deployment api language laravel framework developer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework