[ANN] Lasso-HTTP Production Ready

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

[ANN] Lasso-HTTP Production Ready

Brad Lindsay
I mentioned a while back a small library I was working on to replace
[include_url] when it came to issuing requests to HTTP APIs. I have had
a lot of great feedback from various people (thank you all - especially
Jono), and it is now ready for production use.

You can find the code on Github here:
     https://github.com/bfad/Lasso-HTTP


It consists of two types, one that allows you to build a request like this:

local(req) = http_request("http://example.com/foo")

#req->headers    = (:'Content-Type'='application/json')
#req->postParams = json_serialize(map('moose'='hair'))
#req->timeout    = 300


Or, you can create a request all in one method call:

local(req) = http_request(
     "http://example.com/foo",
     -postParams = (:'name'='Rhino'),
     -reqMethod  = `PUT`
)


Once you have a request built, you can get the result back in an
http_response type and easily inspect the various parts:

// If the request doesn't return with a 200 status code, error with the
status and message
// Otherwise show the body of the HTTP response
local(resp) = #req->response
fail_if(#resp->getStatus != 200, #resp->statusCode, #resp->statusMsg)
#resp->bodyString



More often then not, this is probably the form your code will take:

local(resp) = http_request(
     "http://example.com/foo",
     -postParams = (:'name'='Rhino'),
     -reqMethod  = `PUT`
)->response

match(#resp->statusCode) => {
case(400)
     content_body = 'Malformed Request'
case(401)
     content_body = 'Credentials Expired'
case(200)
     content_body = #resp->bodyString
case
     fail(#resp->statusCode, #resp->statusMsg)
}


Once again, the project is hosted on Github:
     https://github.com/bfad/Lasso-HTTP
Please use Github's Issues to submit feature requests or bug reports.


Thanks,
Brad



#lasso9 #curl #restapi
#############################################################
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: [ANN] Lasso-HTTP Production Ready

Bil Corry-3
Can it maintain state by capturing, storing, then sending back cookie values?

Or is it a single-request usage?

- Bil

On Mar 22, 2014, at 3:16 PM, Brad Lindsay <[hidden email]> wrote:

> I mentioned a while back a small library I was working on to replace [include_url] when it came to issuing requests to HTTP APIs. I have had a lot of great feedback from various people (thank you all - especially Jono), and it is now ready for production use.
>
> You can find the code on Github here:
>    https://github.com/bfad/Lasso-HTTP
>
>
> It consists of two types, one that allows you to build a request like this:
>
> local(req) = http_request("http://example.com/foo")
>
> #req->headers    = (:'Content-Type'='application/json')
> #req->postParams = json_serialize(map('moose'='hair'))
> #req->timeout    = 300
>
>
> Or, you can create a request all in one method call:
>
> local(req) = http_request(
>    "http://example.com/foo",
>    -postParams = (:'name'='Rhino'),
>    -reqMethod  = `PUT`
> )
>
>
> Once you have a request built, you can get the result back in an http_response type and easily inspect the various parts:
>
> // If the request doesn't return with a 200 status code, error with the status and message
> // Otherwise show the body of the HTTP response
> local(resp) = #req->response
> fail_if(#resp->getStatus != 200, #resp->statusCode, #resp->statusMsg)
> #resp->bodyString
>
>
>
> More often then not, this is probably the form your code will take:
>
> local(resp) = http_request(
>    "http://example.com/foo",
>    -postParams = (:'name'='Rhino'),
>    -reqMethod  = `PUT`
> )->response
>
> match(#resp->statusCode) => {
> case(400)
>    content_body = 'Malformed Request'
> case(401)
>    content_body = 'Credentials Expired'
> case(200)
>    content_body = #resp->bodyString
> case
>    fail(#resp->statusCode, #resp->statusMsg)
> }
>
>
> Once again, the project is hosted on Github:
>    https://github.com/bfad/Lasso-HTTP
> Please use Github's Issues to submit feature requests or bug reports.
>
>
> Thanks,
> Brad
>
>
>
> #lasso9 #curl #restapi
> #############################################################
> 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: [ANN] Lasso-HTTP Production Ready

decorior
In reply to this post by Brad Lindsay
What is the best place to put this in the lasso 9 structure?


On Mar 22, 2014, at 8:16 AM, Brad Lindsay <[hidden email]> wrote:

> I mentioned a while back a small library I was working on to replace [include_url] when it came to issuing requests to HTTP APIs. I have had a lot of great feedback from various people (thank you all - especially Jono), and it is now ready for production use.
>
> You can find the code on Github here:
>    https://github.com/bfad/Lasso-HTTP
>
>
> It consists of two types, one that allows you to build a request like this:
>
> local(req) = http_request("http://example.com/foo")
>
> #req->headers    = (:'Content-Type'='application/json')
> #req->postParams = json_serialize(map('moose'='hair'))
> #req->timeout    = 300
>
>
> Or, you can create a request all in one method call:
>
> local(req) = http_request(
>    "http://example.com/foo",
>    -postParams = (:'name'='Rhino'),
>    -reqMethod  = `PUT`
> )
>
>
> Once you have a request built, you can get the result back in an http_response type and easily inspect the various parts:
>
> // If the request doesn't return with a 200 status code, error with the status and message
> // Otherwise show the body of the HTTP response
> local(resp) = #req->response
> fail_if(#resp->getStatus != 200, #resp->statusCode, #resp->statusMsg)
> #resp->bodyString
>
>
>
> More often then not, this is probably the form your code will take:
>
> local(resp) = http_request(
>    "http://example.com/foo",
>    -postParams = (:'name'='Rhino'),
>    -reqMethod  = `PUT`
> )->response
>
> match(#resp->statusCode) => {
> case(400)
>    content_body = 'Malformed Request'
> case(401)
>    content_body = 'Credentials Expired'
> case(200)
>    content_body = #resp->bodyString
> case
>    fail(#resp->statusCode, #resp->statusMsg)
> }
>
>
> Once again, the project is hosted on Github:
>    https://github.com/bfad/Lasso-HTTP
> Please use Github's Issues to submit feature requests or bug reports.
>
>
> Thanks,
> Brad
>
>
>
> #lasso9 #curl #restapi
> #############################################################
> 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: [ANN] Lasso-HTTP Production Ready

Jolle Carlestam-2
> 23 mar 2014 kl. 03:33 skrev deco rior <[hidden email]>:
>
> What is the best place to put this in the lasso 9 structure?

I'd say in LassoLibraries, LassoStartup or a LassoApp depending on how you prefer to store custom types and methods.

We store ours in LassoApps.

By the way, Brad, Nice Work!


HDB
Jolle

Sent from a thin, flat, touchy device from an undetermined place in space.
#############################################################
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: [ANN] Lasso-HTTP Production Ready

Jonathan Guthrie-3
In reply to this post by Brad Lindsay
On Mar 22, 2014, at 10:16 AM, Brad Lindsay <[hidden email]> wrote:

> I mentioned a while back a small library I was working on to replace [include_url] when it came to issuing requests to HTTP APIs. I have had a lot of great feedback from various people (thank you all - especially Jono), and it is now ready for production use.

FWIW it's in use in the Lasso 9 GitHub API (https://github.com/iamjono/lasso9-github-api) that we're working on, and it makes things significantly easier.
Thanks Brad, great work :)

Jono

----------------------------
Jonathan Guthrie
[hidden email]
@iamjono
LassoSoft Inc.
AIM Chatroom: lassochat

#############################################################
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: [ANN] Lasso-HTTP Production Ready

decorior
In reply to this post by Brad Lindsay
HI, Brad:

This is terrific stuff

I was wondering about error reporting. I have some examples below that fail, but these could happen in production because the third-party service becomes unavailable for some reason. What are your recommendations for handling these types of errors? I am perfectly happy to have the methods not handling them, but would like to understand how you handle them in lasso 9



I started testing the code. I did run into this:

I entered a url that could not be found (on purpose)


An unhandled failure during a web request
Error Code: 6
Error Msg: Couldn't resolve host name
Error Stack:

If I enter a file that could not be found I get this (on purpose again)

An unhandled failure during a web request
Error Code: 500
Error Msg: Internal
Error Stack:




Deco



On Mar 22, 2014, at 8:16 AM, Brad Lindsay <[hidden email]> wrote:

> I mentioned a while back a small library I was working on to replace [include_url] when it came to issuing requests to HTTP APIs. I have had a lot of great feedback from various people (thank you all - especially Jono), and it is now ready for production use.
>
> You can find the code on Github here:
>    https://github.com/bfad/Lasso-HTTP
>
>
> It consists of two types, one that allows you to build a request like this:
>
> local(req) = http_request("http://example.com/foo")
>
> #req->headers    = (:'Content-Type'='application/json')
> #req->postParams = json_serialize(map('moose'='hair'))
> #req->timeout    = 300
>
>
> Or, you can create a request all in one method call:
>
> local(req) = http_request(
>    "http://example.com/foo",
>    -postParams = (:'name'='Rhino'),
>    -reqMethod  = `PUT`
> )
>
>
> Once you have a request built, you can get the result back in an http_response type and easily inspect the various parts:
>
> // If the request doesn't return with a 200 status code, error with the status and message
> // Otherwise show the body of the HTTP response
> local(resp) = #req->response
> fail_if(#resp->getStatus != 200, #resp->statusCode, #resp->statusMsg)
> #resp->bodyString
>
>
>
> More often then not, this is probably the form your code will take:
>
> local(resp) = http_request(
>    "http://example.com/foo",
>    -postParams = (:'name'='Rhino'),
>    -reqMethod  = `PUT`
> )->response
>
> match(#resp->statusCode) => {
> case(400)
>    content_body = 'Malformed Request'
> case(401)
>    content_body = 'Credentials Expired'
> case(200)
>    content_body = #resp->bodyString
> case
>    fail(#resp->statusCode, #resp->statusMsg)
> }
>
>
> Once again, the project is hosted on Github:
>    https://github.com/bfad/Lasso-HTTP
> Please use Github's Issues to submit feature requests or bug reports.
>
>
> Thanks,
> Brad
>
>
>
> #lasso9 #curl #restapi
> #############################################################
> 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: [ANN] Lasso-HTTP Production Ready

Brad Lindsay
In reply to this post by Bil Corry-3
On 3/22/14, 12:27 PM, Bil Corry wrote:
> Can it maintain state by capturing, storing, then sending back cookie values?
>
> Or is it a single-request usage?

Quick answer: It's single-request usage, but you could store cookies
yourself.

The http_request type builds a single request. The built request can be
called multiple times. Each time it is called it creates a new
http_response. The http_response type just holds a single HTTP response
and knows nothing of the http_request that called it. (It takes in
either the raw bytes / string of the HTTP response or a staticarray
generated from calling Lasso curl->raw.)

You could fairly easily inspect the headers for cookies and then add
those cookies to the http_request object's headers, but since the
http_response knows nothing of the http_request type, it can't populate
the cookie headers back.

This would be an interesting feature request, but I'm not sure about
implementing it as I'm not so sure I like the idea of an http_response
object going behind the programmers back and modifying the http_request
object that was created. Though if it weren't the default but a flag
that was explicitly set when the call was made, that could be workable.
However, I think that maybe that functionality should be in the custom
type that uses these libraries. (But I am open to being convinced
otherwise.)


Brad
#############################################################
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: [ANN] Lasso-HTTP Production Ready

Brad Lindsay
In reply to this post by decorior
On 3/22/14, 1:33 PM, deco rior wrote:
> What is the best place to put this in the lasso 9 structure?

Stick the two lasso files in LassoStartup. If you want, you could
compile them and stick the results in LassoLibraries. If you want them
for a specific LassoApp you're creating, you could work them in the
LassoApp itself and configure them to load when it loads.

Since they're meant to be standard library kinds of things, I should
probably create a makefile to make compilation easier for people.


Brad
#############################################################
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: [ANN] Lasso-HTTP Production Ready

Brad Lindsay
In reply to this post by decorior
On 3/23/14, 10:22 AM, deco rior wrote:
> HI, Brad:
>
> This is terrific stuff
>
> I was wondering about error reporting. I have some examples below that fail, but these could happen in production because the third-party service becomes unavailable for some reason. What are your recommendations for handling these types of errors? I am perfectly happy to have the methods not handling them, but would like to understand how you handle them in lasso 9

First, it's worth noting that include_url exhibits the same behavior for
the cases you mention. I would handle them the same way you do in Lasso
8 - use handle or handle_error blocks:
http://lassoguide.com/language/error-handling.html#id2



> I started testing the code. I did run into this:
>
> I entered a url that could not be found (on purpose)
>
>
> An unhandled failure during a web request
> Error Code: 6
> Error Msg: Couldn't resolve host name
> Error Stack:

You get this if you issue something like this where the domain name
doesn't exist:
     http_request('http://domainname.com')->response

I don't think I would change this behavior. You're expecting an
http_response, but I can't give one to you since I never received one,
so it throws the proper error.


> If I enter a file that could not be found I get this (on purpose again)
>
> An unhandled failure during a web request
> Error Code: 500
> Error Msg: Internal
> Error Stack:

I'm not sure what you're doing here. If I issue a request such as this:
     local(resp) =
http_request('http://www.google.com/test1.lasso')->response
Where the domain name exists but the path does not, I get an
http_response type back. It's statusCode is 404, as you'd expect, and it
has the domain's 404 response page in the body. Are you printing out the
body you received? If so, then it sounds like everything worked just
fine except whatever is going on in the remote system to produce a 500
instead of a 404.


HTH,
Brad
#############################################################
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: [ANN] Lasso-HTTP Production Ready

decorior
Thanks,

In addition with include_url I get a valid response but I am getting this with http_request

An unhandled failure during a web request
Error Code: 409
Error Msg: Conflict
Error Stack:

)

 include_url(
                        `https://api.madmimi.com/mailer`,
                         -POSTParams=#post_params
                         )

OR
               
                http_request(
                        `https://api.madmimi.com/mailer`,
                        -POSTParams=#post_params,
                        -reqMethod = `POST`
                        )->response;
On Mar 23, 2014, at 9:55 AM, Brad Lind

say <[hidden email]> wrote:

> On 3/23/14, 10:22 AM, deco rior wrote:
>> HI, Brad:
>>
>> This is terrific stuff
>>
>> I was wondering about error reporting. I have some examples below that fail, but these could happen in production because the third-party service becomes unavailable for some reason. What are your recommendations for handling these types of errors? I am perfectly happy to have the methods not handling them, but would like to understand how you handle them in lasso 9
>
> First, it's worth noting that include_url exhibits the same behavior for the cases you mention. I would handle them the same way you do in Lasso 8 - use handle or handle_error blocks:
> http://lassoguide.com/language/error-handling.html#id2
>
>
>
>> I started testing the code. I did run into this:
>>
>> I entered a url that could not be found (on purpose)
>>
>>
>> An unhandled failure during a web request
>> Error Code: 6
>> Error Msg: Couldn't resolve host name
>> Error Stack:
>
> You get this if you issue something like this where the domain name doesn't exist:
>    http_request('http://domainname.com')->response
>
> I don't think I would change this behavior. You're expecting an http_response, but I can't give one to you since I never received one, so it throws the proper error.
>
>
>> If I enter a file that could not be found I get this (on purpose again)
>>
>> An unhandled failure during a web request
>> Error Code: 500
>> Error Msg: Internal
>> Error Stack:
>
> I'm not sure what you're doing here. If I issue a request such as this:
>    local(resp) = http_request('http://www.google.com/test1.lasso')->response
> Where the domain name exists but the path does not, I get an http_response type back. It's statusCode is 404, as you'd expect, and it has the domain's 404 response page in the body. Are you printing out the body you received? If so, then it sounds like everything worked just fine except whatever is going on in the remote system to produce a 500 instead of a 404.
>
>
> HTH,
> Brad
> #############################################################
> 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: [ANN] Lasso-HTTP Production Ready

decorior
Ignore last post...my error

Deco
On Mar 23, 2014, at 11:18 AM, deco rior <[hidden email]> wrote:

> Thanks,
>
> In addition with include_url I get a valid response but I am getting this with http_request
>
> An unhandled failure during a web request
> Error Code: 409
> Error Msg: Conflict
> Error Stack:
>
> )
>
> include_url(
> `https://api.madmimi.com/mailer`,
> -POSTParams=#post_params
> )
>
> OR
>
> http_request(
> `https://api.madmimi.com/mailer`,
> -POSTParams=#post_params,
> -reqMethod = `POST`
> )->response;
> On Mar 23, 2014, at 9:55 AM, Brad Lind
>
> say <[hidden email]> wrote:
>
>> On 3/23/14, 10:22 AM, deco rior wrote:
>>> HI, Brad:
>>>
>>> This is terrific stuff
>>>
>>> I was wondering about error reporting. I have some examples below that fail, but these could happen in production because the third-party service becomes unavailable for some reason. What are your recommendations for handling these types of errors? I am perfectly happy to have the methods not handling them, but would like to understand how you handle them in lasso 9
>>
>> First, it's worth noting that include_url exhibits the same behavior for the cases you mention. I would handle them the same way you do in Lasso 8 - use handle or handle_error blocks:
>> http://lassoguide.com/language/error-handling.html#id2
>>
>>
>>
>>> I started testing the code. I did run into this:
>>>
>>> I entered a url that could not be found (on purpose)
>>>
>>>
>>> An unhandled failure during a web request
>>> Error Code: 6
>>> Error Msg: Couldn't resolve host name
>>> Error Stack:
>>
>> You get this if you issue something like this where the domain name doesn't exist:
>>   http_request('http://domainname.com')->response
>>
>> I don't think I would change this behavior. You're expecting an http_response, but I can't give one to you since I never received one, so it throws the proper error.
>>
>>
>>> If I enter a file that could not be found I get this (on purpose again)
>>>
>>> An unhandled failure during a web request
>>> Error Code: 500
>>> Error Msg: Internal
>>> Error Stack:
>>
>> I'm not sure what you're doing here. If I issue a request such as this:
>>   local(resp) = http_request('http://www.google.com/test1.lasso')->response
>> Where the domain name exists but the path does not, I get an http_response type back. It's statusCode is 404, as you'd expect, and it has the domain's 404 response page in the body. Are you printing out the body you received? If so, then it sounds like everything worked just fine except whatever is going on in the remote system to produce a 500 instead of a 404.
>>
>>
>> HTH,
>> Brad
>> #############################################################
>> 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]>

#############################################################
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: Lasso-HTTP Problems - Was: [ANN] Lasso-HTTP Production Ready

Brad Lindsay
In reply to this post by decorior
First, just a general request for people to use Github's Issues area for
feature requests and bug reports - more visibility for Lasso the better,
and other people who run into similar issues can see how they are resolved.

Deco -

One of the reasons a 409 Conflict could have been issued is to prevent
an edit conflict - essentially one of the resource you were trying to
modify was recently modified and they don't want you to modify it again.
(For example, must credit-card APIs won't let you charge the same card
twice for the same amount in quick succession. I would check to see if
that's the issue. If you need more help troubleshooting, you can email
me the post_params off list and I can take a look.


Brad


On 3/23/14, 1:18 PM, deco rior wrote:

> Thanks,
>
> In addition with include_url I get a valid response but I am getting this with http_request
>
> An unhandled failure during a web request
> Error Code: 409
> Error Msg: Conflict
> Error Stack:
>
> )
>
>   include_url(
> `https://api.madmimi.com/mailer`,
> -POSTParams=#post_params
> )
>
> OR
>
> http_request(
> `https://api.madmimi.com/mailer`,
> -POSTParams=#post_params,
> -reqMethod = `POST`
> )->response;
> On Mar 23, 2014, at 9:55 AM, Brad Lind
>
> say<[hidden email]>  wrote:
>
>> On 3/23/14, 10:22 AM, deco rior wrote:
>>> HI, Brad:
>>>
>>> This is terrific stuff
>>>
>>> I was wondering about error reporting. I have some examples below that fail, but these could happen in production because the third-party service becomes unavailable for some reason. What are your recommendations for handling these types of errors? I am perfectly happy to have the methods not handling them, but would like to understand how you handle them in lasso 9
>> First, it's worth noting that include_url exhibits the same behavior for the cases you mention. I would handle them the same way you do in Lasso 8 - use handle or handle_error blocks:
>> http://lassoguide.com/language/error-handling.html#id2
>>
>>
>>
>>> I started testing the code. I did run into this:
>>>
>>> I entered a url that could not be found (on purpose)
>>>
>>>
>>> An unhandled failure during a web request
>>> Error Code: 6
>>> Error Msg: Couldn't resolve host name
>>> Error Stack:
>> You get this if you issue something like this where the domain name doesn't exist:
>>     http_request('http://domainname.com')->response
>>
>> I don't think I would change this behavior. You're expecting an http_response, but I can't give one to you since I never received one, so it throws the proper error.
>>
>>
>>> If I enter a file that could not be found I get this (on purpose again)
>>>
>>> An unhandled failure during a web request
>>> Error Code: 500
>>> Error Msg: Internal
>>> Error Stack:
>> I'm not sure what you're doing here. If I issue a request such as this:
>>     local(resp) = http_request('http://www.google.com/test1.lasso')->response
>> Where the domain name exists but the path does not, I get an http_response type back. It's statusCode is 404, as you'd expect, and it has the domain's 404 response page in the body. Are you printing out the body you received? If so, then it sounds like everything worked just fine except whatever is going on in the remote system to produce a 500 instead of a 404.
>>
>>
>> HTH,
>> Brad
>> #############################################################
>> 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]>
#############################################################
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]>