FAQ
Hello,

I'm calling a page with jQuery's $.ajax() and I want it to return a
status code (201 if ok, 400 if some parameters are missing). The goal is
to use .done() and .fail()

I guess that's the way to go but apart when doing redirects (with
$http_header_out('location',['/page',302]) )I don't know how to set a
HTTP status code from embperl.

I thought exit 400 would work but it seems not. $req->status(400) does
not exist (anymore?)

Thanks for your help.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org

Search Discussions

  • Gerald Richter at Oct 3, 2012 at 10:00 am
    Exit (400) should work, but you need to set optReturnError (see http://www.embperl.org/embperl/pod/doc/Config.-page-2-.htm#sect_43)

    Gerald

    -----Original Message-----
    From: Jean-Christophe Boggio
    Sent: Wednesday, September 26, 2012 11:48 PM
    To: embperl@perl.apache.org
    Subject: Setting status code

    Hello,

    I'm calling a page with jQuery's $.ajax() and I want it to return a status code
    (201 if ok, 400 if some parameters are missing). The goal is to use .done() and
    .fail()

    I guess that's the way to go but apart when doing redirects (with
    $http_header_out('location',['/page',302]) )I don't know how to set a HTTP
    status code from embperl.

    I thought exit 400 would work but it seems not. $req->status(400) does not
    exist (anymore?)

    Thanks for your help.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupembperl @
categoriesmodperl, perl
postedSep 26, '12 at 9:48p
activeOct 3, '12 at 10:00a
posts2
users2
websiteperl.apache.org

People

Translate

site design / logo © 2018 Grokbase