FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18745&edit=1

ID: 18745
Updated by: daniel.oconnor@gmail.com
Reported By: rico dot sonntag at netresearch dot de
Summary: optionally throw exception when HTTP error status
code sent
Status: Open
Type: Feature/Change Request
Package: HTTP_Request2
Package Version: 2.0.0RC1
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

I'm mixed about this: though HTTP 200 OK is a very common status code;
with most
others meaning bad things; the HTTP spec defines quite a lot of
behaviours.

Is HTTP 303 See Other a success or failure? Neither really. HTTP 404?
Well...
missing isn't really broken. HTTP 418? Perhaps that's what you want in a
server
sometimes.

Rico; couldn't you just extend one of the HTTP Request2 Adapters to add
in this
behaviour? IE an acceptable result code adapter?


Previous Comments:
------------------------------------------------------------------------

[2011-08-19 11:12:21] ricson

Description:
------------
It'd be nice if I could configure HTTP_Request2 to automatically throw
an exception when a non-200 status code is returned.

This should of course be an optional config option.

------------------------------------------------------------------------

Search Discussions

  • Borz_off at Aug 23, 2011 at 5:19 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18745&edit=1

    ID: 18745
    Updated by: borz_off@cs.msu.su
    Reported By: rico dot sonntag at netresearch dot de
    Summary: optionally throw exception when HTTP error status
    code sent
    -Status: Open
    +Status: Wont fix
    Type: Feature/Change Request
    Package: HTTP_Request2
    Package Version: 2.0.0RC1
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Wont fix
    There is nothing "exceptional" in HTTP status code other than 200 for
    HTTP_Request2 package. This is just another valid HTTP response, which
    HTTP_Request2 can properly handle, parse and return, unlike e.g.
    connection errors and timeouts. If such a code is "exceptional" for your
    application, then your application should react with an exception.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-08-19 14:46:51] doconnor

    I'm mixed about this: though HTTP 200 OK is a very common status code;
    with most
    others meaning bad things; the HTTP spec defines quite a lot of
    behaviours.

    Is HTTP 303 See Other a success or failure? Neither really. HTTP 404?
    Well...
    missing isn't really broken. HTTP 418? Perhaps that's what you want in a
    server
    sometimes.

    Rico; couldn't you just extend one of the HTTP Request2 Adapters to add
    in this
    behaviour? IE an acceptable result code adapter?

    ------------------------------------------------------------------------

    [2011-08-19 11:12:21] ricson

    Description:
    ------------
    It'd be nice if I could configure HTTP_Request2 to automatically throw
    an exception when a non-200 status code is returned.

    This should of course be an optional config option.

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 19, '11 at 12:46p
activeAug 23, '11 at 5:19a
posts2
users2
websitepear.php.net

2 users in discussion

Borz_off: 1 post Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase