Array to GET query

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

Array to GET query

Jussi Hirvi-2
I am replicating a payment gateway code from php to lasso 8.6.

I need to try XML requests soon, which will be adventurous, but first I
need to find a way to transform a pair array to a URL-encoded GET query.

The corresponding php tag is http_build_query:

http://php.net/manual/en/function.http-build-query.php

I notice that it replaces spaces with plus signs, not %20.

How to replicate this tag in Lasso?

- Jussi

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Array to GET query

Jussi Hirvi-2
I changed my plan, as I find no practical way of doing an automatic post
request with Lasso 8. With Lasso 9 there would be curl.

So I am going to use their old-fashioned API which does not require XML
or anything fancy.

So you can skip my question - but still, I am curious to hear if any of
you have thoughts about this.

- Jussi

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Array to GET query

jasonhuck
[include_url] supports POST requests via libcurl in Lasso 8 in much the
same way as Lasso 9 AFAIK. The Lasso 9 implementation exposes some
additional features, but you can definitely post data with LP8. If you pass
a pair array into the -postparams keyword, it will automatically convert it
into post args for you. If you pass it a string, it will pass that string
as the post body, which is what you would do if you needed to send XML,
JSON, etc.

Plus signs vs. %20 for spaces shouldn't matter -- both will typically work
-- but if it's a problem, just do a string replace on the spaces before you
encode the values.

- jason




On Wed, Dec 2, 2015 at 8:23 AM, Jussi Hirvi <[hidden email]> wrote:

> I changed my plan, as I find no practical way of doing an automatic post
> request with Lasso 8. With Lasso 9 there would be curl.
>
> So I am going to use their old-fashioned API which does not require XML or
> anything fancy.
>
> So you can skip my question - but still, I am curious to hear if any of
> you have thoughts about this.
>
>
> - Jussi
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Array to GET query

Jussi Hirvi-2
On 2.12.2015 15.56, Jason Huck wrote:
> [include_url] supports POST requests via libcurl in Lasso 8 in much the
> same way as Lasso 9 AFAIK.

Oh yes, I didn't come to think of include_url at all. Maybe I will try
that at some point.

- Jussi


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>