secure REST client?

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

secure REST client?

wkitty42

i'm looking at creating a REST web application client... nothing fancy...
command line oriented... fire it up, it logs into the website and performs the
REST queries saving the output to named files...

i have no clue where to start looking in the FPC documentation or any existing
libraries... i have toyed with something using fpweb that would pull some pages
from a site for scraping but that idea is no longer being considered...

firstly i'm not sure how to go about doing the login ops with cookies and
such... the site gives some assistance and examples for using wget and curl but
i think i'd prefer to handle this in my client... currently there's a "normal"
login on an existing non-REST site and then there's a new method of login on the
REST site... i haven't been able to figure out how to convert my fpweb client so
that it properly logs in and retains the login so that subsequent queries will
work...

this is extremely new territory for me coming from TP6/7...

help?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: secure REST client?

Michael Van Canneyt


On Thu, 8 Nov 2012, waldo kitty wrote:

>
> i'm looking at creating a REST web application client... nothing fancy...
> command line oriented... fire it up, it logs into the website and performs
> the REST queries saving the output to named files...
>
> i have no clue where to start looking in the FPC documentation or any
> existing libraries... i have toyed with something using fpweb that would pull
> some pages from a site for scraping but that idea is no longer being
> considered...

Why not ?

>
> firstly i'm not sure how to go about doing the login ops with cookies and
> such... the site gives some assistance and examples for using wget and curl
> but i think i'd prefer to handle this in my client... currently there's a
> "normal" login on an existing non-REST site and then there's a new method of
> login on the REST site... i haven't been able to figure out how to convert my
> fpweb client so that it properly logs in and retains the login so that
> subsequent queries will work...

I have done this in several projects using fpweb (specifically fphttpclient).
Usually it is simply a matter of retaining some cookies.

if you give more details, maybe I can offer more help ?

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: secure REST client?

wkitty42
On 11/8/2012 17:11, Michael Van Canneyt wrote:

>
>
> On Thu, 8 Nov 2012, waldo kitty wrote:
>
>>
>> i'm looking at creating a REST web application client... nothing fancy...
>> command line oriented... fire it up, it logs into the website and performs the
>> REST queries saving the output to named files...
>>
>> i have no clue where to start looking in the FPC documentation or any existing
>> libraries... i have toyed with something using fpweb that would pull some
>> pages from a site for scraping but that idea is no longer being considered...
>
> Why not ?

mainly because the data is better gathered from the other site with REST... no
need to screenscrape from there or have to deal with a lack of data because the
1st site hasn't gathered it ;)

>> firstly i'm not sure how to go about doing the login ops with cookies and
>> such... the site gives some assistance and examples for using wget and curl
>> but i think i'd prefer to handle this in my client... currently there's a
>> "normal" login on an existing non-REST site and then there's a new method of
>> login on the REST site... i haven't been able to figure out how to convert my
>> fpweb client so that it properly logs in and retains the login so that
>> subsequent queries will work...
>
> I have done this in several projects using fpweb (specifically fphttpclient).
> Usually it is simply a matter of retaining some cookies.

you should recall my recent foray into using that code... i had asked about
persistent connections because mine weren't completing until i included headers
to state the connection was to be closed...

> if you give more details, maybe I can offer more help ?

i'm not sure what to give... i have no clue how to gather cookie data and send
it back based on the existing example(s) that i've seen :(

i do know that i was unable to use the REST site's sample wget cookie stuff make
requests to the "normal" login site... i don't know how to state that properly
since i'm not sure how either site is really working in this aspect... i only
know that the cookie stuff apparently didn't work as described by simply
changing the site address from one to the other...
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: secure REST client?

Виктор Матузенко

Ккк

09.11.2012 7:12 пользователь "waldo kitty" <[hidden email]> написал:
On 11/8/2012 17:11, Michael Van Canneyt wrote:


On Thu, 8 Nov 2012, waldo kitty wrote:


i'm looking at creating a REST web application client... nothing fancy...
command line oriented... fire it up, it logs into the website and performs the
REST queries saving the output to named files...

i have no clue where to start looking in the FPC documentation or any existing
libraries... i have toyed with something using fpweb that would pull some
pages from a site for scraping but that idea is no longer being considered...

Why not ?

mainly because the data is better gathered from the other site with REST... no need to screenscrape from there or have to deal with a lack of data because the 1st site hasn't gathered it ;)

firstly i'm not sure how to go about doing the login ops with cookies and
such... the site gives some assistance and examples for using wget and curl
but i think i'd prefer to handle this in my client... currently there's a
"normal" login on an existing non-REST site and then there's a new method of
login on the REST site... i haven't been able to figure out how to convert my
fpweb client so that it properly logs in and retains the login so that
subsequent queries will work...

I have done this in several projects using fpweb (specifically fphttpclient).
Usually it is simply a matter of retaining some cookies.

you should recall my recent foray into using that code... i had asked about persistent connections because mine weren't completing until i included headers to state the connection was to be closed...

if you give more details, maybe I can offer more help ?

i'm not sure what to give... i have no clue how to gather cookie data and send it back based on the existing example(s) that i've seen :(

i do know that i was unable to use the REST site's sample wget cookie stuff make requests to the "normal" login site... i don't know how to state that properly since i'm not sure how either site is really working in this aspect... i only know that the cookie stuff apparently didn't work as described by simply changing the site address from one to the other...
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: secure REST client?

wkitty42
On 11/8/2012 22:15, Виктор Матузенко wrote:
> Ккк

what? i don't understand how this is related to my query :? :(


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: secure REST client?

Michael Van Canneyt
In reply to this post by wkitty42


On Thu, 8 Nov 2012, waldo kitty wrote:

>>> "normal" login on an existing non-REST site and then there's a new method
>>> of
>>> login on the REST site... i haven't been able to figure out how to convert
>>> my
>>> fpweb client so that it properly logs in and retains the login so that
>>> subsequent queries will work...
>>
>> I have done this in several projects using fpweb (specifically
>> fphttpclient).
>> Usually it is simply a matter of retaining some cookies.
>
> you should recall my recent foray into using that code... i had asked about
> persistent connections because mine weren't completing until i included
> headers to state the connection was to be closed...
>
>> if you give more details, maybe I can offer more help ?
>
> i'm not sure what to give... i have no clue how to gather cookie data and
> send it back based on the existing example(s) that i've seen :(
>
> i do know that i was unable to use the REST site's sample wget cookie stuff
> make requests to the "normal" login site... i don't know how to state that
> properly since i'm not sure how either site is really working in this
> aspect... i only know that the cookie stuff apparently didn't work as
> described by simply changing the site address from one to the other...

Without more details, it is hard to give advice.
I can only say that I do something similar to what you describe with fphttpclient.
If the persistent connection is a problem, you can try synapses httpsend class.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: secure REST client?

Виктор Матузенко
In reply to this post by wkitty42
Sorry, It was sent by mistake from my android device...

09.11.2012 7:19, waldo kitty пишет:
> On 11/8/2012 22:15, Виктор Матузенко wrote:
>> Ккк
>
> what? i don't understand how this is related to my query :? :(
>

--
Victor Matuzenko (Виктор Матузенко)

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: secure REST client?

wallisonline
This post has NOT been accepted by the mailing list yet.
How can I do Secure business in credit system?