Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16007 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95365 invoked by uid 1010); 18 Apr 2005 16:18:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95350 invoked by uid 1007); 18 Apr 2005 16:18:51 -0000 Message-ID: <20050418161850.95343.qmail@lists.php.net> To: internals@lists.php.net References: <20050418141035.FKCI10174.aamta07-winn.mailhost.ntl.com@win2ks> Date: Mon, 18 Apr 2005 09:18:49 -0700 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-Posted-By: 70.6.100.184 Subject: Re: HTTP streams, status codes & WebDAV From: pollita@php.net ("Sara Golemon") > Was hoping to use PHP streams API to query a WebDAV server, something > along the lines of.. > > $context = stream_context_create( > array( > 'http' => > array('method' => 'PROPFIND') > ) > ); > $f = fopen('http://localhost/WebDav/', 'r', FALSE, $context); > > fpassthru($f); > fclose($f); > > but the streams API seems overly strict on status codes returned, a > succesful PROPFIND is meant to return a 207 status code, but the > HTTP stream wrapper isn't treating it as such, throwing an error, and > failing to open. Is this a bug? > Short Answer: http://pear.php.net/package/HTTP_WebDAV_Client Long Answer: Although the content is tossed out, you can see the status codes and any other headers in $http_response_header whether the http request returned a "valid" response code or not. That said, a context option to optionally accept additional response codes *may* be in order. -Sara