accessing the current post parameters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

accessing the current post parameters

sergio_101-2
i know i am justing being ridiculous here, but i can't figure out how
to access the post parameters in my component.

i am writing a facebook app, and i just need to grab the response from
the auth dialog, but i can't figure out how to do it..

in looking at the source, and it looks like i should get it at:

WARequest #currentRequest inspect.

but i can't get at it .

can anyone steer me in the right direction?

thanks!

--
----
peace,
sergio
photographer, journalist, visionary

http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: accessing the current post parameters

Philippe Marschall
2012/2/12 sergio_101 <[hidden email]>:
> i know i am justing being ridiculous here, but i can't figure out how
> to access the post parameters in my component.
>
> i am writing a facebook app, and i just need to grab the response from
> the auth dialog, but i can't figure out how to do it..
>
> in looking at the source, and it looks like i should get it at:
>
> WARequest #currentRequest inspect.

self requestContext request
should do it

> but i can't get at it .
>
> can anyone steer me in the right direction?

Are you in the render phase instead of the continuation? Eg. is the
request you're seeing a GET instead of a POST request?

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: accessing the current post parameters

sergio_101-2
>
> Are you in the render phase instead of the continuation? Eg. is the
> request you're seeing a GET instead of a POST request?

ah.. ok. this is the very beginning for my site.. so there is only one
component.. a render..
i tried running:

renderContentOn: html
        (self requestContext request) inspect.
        html heading: 'this is the canvas' level: 3

and get this:

<error in printString: evaluate "self printString" to debug>

thanks..


--
----
peace,
sergio
photographer, journalist, visionary

http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: accessing the current post parameters

Philippe Marschall
2012/2/12 sergio_101 <[hidden email]>:
>>
>> Are you in the render phase instead of the continuation? Eg. is the
>> request you're seeing a GET instead of a POST request?
>
> ah.. ok. this is the very beginning for my site.. so there is only one
> component.. a render..
> i tried running:

Usually in this case you would implement #initialRequest:

> renderContentOn: html
>        (self requestContext request) inspect.
>        html heading: 'this is the canvas' level: 3
>
> and get this:
>
> <error in printString: evaluate "self printString" to debug>

Interesting …

What about?

renderContentOn: html
       (self requestContext request) halt.
       html heading: 'this is the canvas' level: 3


Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: accessing the current post parameters

Bob Arning-2
In reply to this post by sergio_101-2
The reason that happens is that, by the time the inspector opens, all the request fields are nil, courtesy of

WARequest>>destroy
WARequestContext>>destroy
[] in WAComancheAdaptor(WAServerAdaptor)>>process:
BlockClosure>>ensure:
WAComancheAdaptor(WAServerAdaptor)>>process:
WAComancheAdaptor>>processHttpRequest:
HttpService>>processHttpRequest:
[] in HttpAdaptor>>dispatchRequest:
BlockClosure>>on:do:
HttpService>>handleDispatchErrorsIn:

This means you won't see anything interesting in the inspector and you'll get an error since WARequest>>printOn: assumes method is a string, not nil. So, if you want to inspect it, add a halt as Philippe suggested.

Cheers,
Bob

On 2/12/12 1:50 PM, sergio_101 wrote:
Are you in the render phase instead of the continuation? Eg. is the
request you're seeing a GET instead of a POST request?
ah.. ok. this is the very beginning for my site.. so there is only one
component.. a render..
i tried running:

renderContentOn: html
	(self requestContext request) inspect.
	html heading: 'this is the canvas' level: 3

and get this:

<error in printString: evaluate "self printString" to debug>

thanks..



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: accessing the current post parameters

Bob Arning-2
In reply to this post by sergio_101-2
Alternatively,

self requestContext request copy inspect.

will let you see what the request looked like before it got destroyed without requiring a halt.

Cheers,
Bob

On 2/12/12 1:50 PM, sergio_101 wrote:
Are you in the render phase instead of the continuation? Eg. is the
request you're seeing a GET instead of a POST request?
ah.. ok. this is the very beginning for my site.. so there is only one
component.. a render..
i tried running:

renderContentOn: html
	(self requestContext request) inspect.
	html heading: 'this is the canvas' level: 3

and get this:

<error in printString: evaluate "self printString" to debug>

thanks..



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: accessing the current post parameters

sergio_101-2
okay, it looks like i was looking at an older version of the facebook spec..

all i really need to do is grab the GET var 'code'...

how do i access that? is there a way i can just grab all REQUEST vars?

sort of like doing a params[] or $this->data in other frameworks..

thanks!



--
----
peace,
sergio
photographer, journalist, visionary

http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: accessing the current post parameters

Bob Arning-2
Did you try

self requestContext request at: 'code'

and

self requestContext request fields

Cheers,
Bob

On 2/13/12 6:25 AM, sergio_101 wrote:
okay, it looks like i was looking at an older version of the facebook spec..

all i really need to do is grab the GET var 'code'...

how do i access that? is there a way i can just grab all REQUEST vars?

sort of like doing a params[] or $this->data in other frameworks..

thanks!




_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside