Re: Forcing a Response Status-Code of 40x

2010-10-03 Thread Raimon Fernandez
uuuch 

it's there !!

I've read it twice before posting here .

:-(

thanks again,

r.


The Response:

You can change these variables to your needs:

• @status is the HTTP status (defaults to 200)
• @headers is a hash with the headers
• @body is the body (a string or something which responds to each)
• Any changes in @cookies and @state will also be sent to the client


On 3oct, 2010, at 22:54 , Magnus Holm wrote:

> There's some info about the request/response here: 
> http://camping.rubyforge.org/api.html#class-Camping-Controllers
> 
> // Magnus Holm
> 
> 
> On Sun, Oct 3, 2010 at 22:47, Raimon Fernandez  wrote:
> Thanks John & Magnus,
> 
> 
> Where I can find more info about those little magic 
> 
> :-)
> 
> Also, I was calling from the wrong place, in a helper it is not working, but 
> works if I call from a Controller.
> 
> thanks again,
> 
> regards,
> 
> r.
> 
> 
> On 3oct, 2010, at 18:22 , John Beppu wrote:
> 
> > @status = 404
> 
> 
> On 3oct, 2010, at 18:21 , Magnus Holm wrote:
> 
> > @status = 404
> 
> 
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
> 
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Forcing a Response Status-Code of 40x

2010-10-03 Thread Magnus Holm
There's some info about the request/response here:
http://camping.rubyforge.org/api.html#class-Camping-Controllers

// Magnus Holm


On Sun, Oct 3, 2010 at 22:47, Raimon Fernandez  wrote:

> Thanks John & Magnus,
>
>
> Where I can find more info about those little magic 
>
> :-)
>
> Also, I was calling from the wrong place, in a helper it is not working,
> but works if I call from a Controller.
>
> thanks again,
>
> regards,
>
> r.
>
>
> On 3oct, 2010, at 18:22 , John Beppu wrote:
>
> > @status = 404
>
>
> On 3oct, 2010, at 18:21 , Magnus Holm wrote:
>
> > @status = 404
>
>
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
>
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Forcing a Response Status-Code of 40x

2010-10-03 Thread Raimon Fernandez
Thanks John & Magnus,


Where I can find more info about those little magic 

:-)

Also, I was calling from the wrong place, in a helper it is not working, but 
works if I call from a Controller.

thanks again,

regards,

r.


On 3oct, 2010, at 18:22 , John Beppu wrote:

> @status = 404


On 3oct, 2010, at 18:21 , Magnus Holm wrote:

> @status = 404


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Forcing a Response Status-Code of 40x

2010-10-03 Thread Magnus Holm
@status = 404

// Magnus Holm


On Sun, Oct 3, 2010 at 18:09, Raimon Fernandez  wrote:

> Hi again,
>
> I'm trying to force a different Response Status-Code when some situations
> occur.
>
> Once again, in Rails I just use the :status => 404 and that's all ...
>
> Here, I suppose I must use the @headers[] but I'm always getting the 200
> Status OK.
>
> I'm not sure wich name exactly the header must be, as in Internet there are
> lots of options and none of them is giving me a 404 or whatever code I use,
> I'm always getting the 200.
>
> If I force a bad url, camping returns the famouse Camping problem with a
> 404 status code, I want to force this code.
>
> How can I do that ?
>
> ...
>
> @headers["Content-Type"] = "text/xml"
>
> # none of them are working ...
>
> @headers["HTTP/1.0"] = "404"
> @headers["Status"] = "404"
> @headers["Response"] = "404"
> @headers["Status-Code"] = "404"
>
> maybe I have to use a different option in camping ?
>
> thanks again,
>
> regards,
>
> r.
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
>
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Forcing a Response Status-Code of 40x

2010-10-03 Thread John Beppu
@status = 404

On Sun, Oct 3, 2010 at 9:09 AM, Raimon Fernandez  wrote:

> Hi again,
>
> I'm trying to force a different Response Status-Code when some situations
> occur.
>
> Once again, in Rails I just use the :status => 404 and that's all ...
>
> Here, I suppose I must use the @headers[] but I'm always getting the 200
> Status OK.
>
> I'm not sure wich name exactly the header must be, as in Internet there are
> lots of options and none of them is giving me a 404 or whatever code I use,
> I'm always getting the 200.
>
> If I force a bad url, camping returns the famouse Camping problem with a
> 404 status code, I want to force this code.
>
> How can I do that ?
>
> ...
>
> @headers["Content-Type"] = "text/xml"
>
> # none of them are working ...
>
> @headers["HTTP/1.0"] = "404"
> @headers["Status"] = "404"
> @headers["Response"] = "404"
> @headers["Status-Code"] = "404"
>
> maybe I have to use a different option in camping ?
>
> thanks again,
>
> regards,
>
> r.
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
>
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Forcing a Response Status-Code of 40x

2010-10-03 Thread Raimon Fernandez
Hi again,

I'm trying to force a different Response Status-Code when some situations occur.

Once again, in Rails I just use the :status => 404 and that's all ...

Here, I suppose I must use the @headers[] but I'm always getting the 200 Status 
OK.

I'm not sure wich name exactly the header must be, as in Internet there are 
lots of options and none of them is giving me a 404 or whatever code I use, I'm 
always getting the 200.

If I force a bad url, camping returns the famouse Camping problem with a 404 
status code, I want to force this code.

How can I do that ?

...

@headers["Content-Type"] = "text/xml"

# none of them are working ...

@headers["HTTP/1.0"] = "404"
@headers["Status"] = "404"
@headers["Response"] = "404"
@headers["Status-Code"] = "404"

maybe I have to use a different option in camping ?

thanks again,

regards,

r.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list