Lasso 8: Include_URL and DELETE

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

Lasso 8: Include_URL and DELETE

Steffan A. Cline
Is there anyway to force include_url to send DELETE rather than post?

I need to emulate :

curl https://my.url/12345 \
   -u username:password \
   -X DELETE

 


Thanks

Steffan

---------------------------------------------------------------
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline   [hidden email]
http://www.ExecuChoice.net                 Phoenix, Arizona USA
                 
---------------------------------------------------------------






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

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: Lasso 8: Include_URL and DELETE

Rick Draper-2
Hi Steffan,

I know from the subject line this is 8, but in 9 we have used...

include_url('http://dev.local/test.lasso?a=&b=2', -options=array(CURLOPT_CUSTOMREQUEST='DELETE'))

not sure if that gives any hints...

when I was trying to get something to work I had tried the following 8 type code...

include_url($target_url,-POSTParams = $json_string, -sendmimeheaders = array('Content-Type'='application/json','X-HTTP-Method-Override'='DELETE'), -verifypeer=true, -string=true, -username='****',-password=*****')

Very best regards,

Rick

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Steffan A. Cline
Sent: Monday, 6 May 2013 3:53 PM
To: Lasso Talk
Subject: Lasso 8: Include_URL and DELETE

Is there anyway to force include_url to send DELETE rather than post?

I need to emulate :

curl https://my.url/12345 \
   -u username:password \
   -X DELETE

 


Thanks

Steffan

---------------------------------------------------------------
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline   [hidden email]
http://www.ExecuChoice.net                 Phoenix, Arizona USA
                 
---------------------------------------------------------------






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

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>




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

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8: Include_URL and DELETE

Steffan A. Cline
I saw that thread but this is definitely Lasso 8.

I have it working using NET tags to emulate curl but was hoping for
something I'm missing in L8.

Thanks

Steffan

---------------------------------------------------------------
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline   [hidden email]
http://www.ExecuChoice.net                 Phoenix, Arizona USA
                 
---------------------------------------------------------------






On 5/5/13 11:38 PM, "Rick Draper" <[hidden email]> wrote:

>Hi Steffan,
>
>I know from the subject line this is 8, but in 9 we have used...
>
>include_url('http://dev.local/test.lasso?a=&b=2',
>-options=array(CURLOPT_CUSTOMREQUEST='DELETE'))
>
>not sure if that gives any hints...
>
>when I was trying to get something to work I had tried the following 8
>type code...
>
>include_url($target_url,-POSTParams = $json_string, -sendmimeheaders =
>array('Content-Type'='application/json','X-HTTP-Method-Override'='DELETE')
>, -verifypeer=true, -string=true, -username='****',-password=*****')
>
>Very best regards,
>
>Rick
>
>-----Original Message-----
>From: [hidden email]
>[mailto:[hidden email]] On Behalf Of Steffan A. Cline
>Sent: Monday, 6 May 2013 3:53 PM
>To: Lasso Talk
>Subject: Lasso 8: Include_URL and DELETE
>
>Is there anyway to force include_url to send DELETE rather than post?
>
>I need to emulate :
>
>curl https://my.url/12345 \
>   -u username:password \
>   -X DELETE
>
>
>
>
>Thanks
>
>Steffan
>
>---------------------------------------------------------------
>T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>Steffan A. Cline   [hidden email]
>http://www.ExecuChoice.net                 Phoenix, Arizona USA
>                  
>---------------------------------------------------------------
>
>
>
>
>
>
>#############################################################
>
>Attend the Lasso Developer Conference 2013!
>Sept 12-14, 2013 in Niagara Falls, Canada
>http://www.lassosoft.com/LDC-niagara-falls-2013
>
>#############################################################
>This message is sent to you because you are subscribed to
>  the mailing list Lasso
>[hidden email]
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>
>
>
>
>#############################################################
>
>Attend the Lasso Developer Conference 2013!
>Sept 12-14, 2013 in Niagara Falls, Canada
>http://www.lassosoft.com/LDC-niagara-falls-2013
>
>#############################################################
>This message is sent to you because you are subscribed to
>  the mailing list Lasso
>[hidden email]
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>



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

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8: Include_URL and DELETE

stevepiercy
Why not use shell or os_process to issue a curl command?

--steve


On 5/5/13 at 11:46 PM, [hidden email] (Steffan A. Cline) pronounced:

> I saw that thread but this is definitely Lasso 8.
>
> I have it working using NET tags to emulate curl but was hoping for
> something I'm missing in L8.
>
> Thanks
>
> Steffan
>
> ---------------------------------------------------------------
> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
> Steffan A. Cline              [hidden email]
> http://www.ExecuChoice.net                 Phoenix, Arizona USA
>                  
> ---------------------------------------------------------------
>
>
>
>
>
>
> On 5/5/13 11:38 PM, "Rick Draper" <[hidden email]> wrote:
>
> >Hi Steffan,
> >
> >I know from the subject line this is 8, but in 9 we have used...
> >
> >include_url('http://dev.local/test.lasso?a=&b=2',
> >-options=array(CURLOPT_CUSTOMREQUEST='DELETE'))
> >
> >not sure if that gives any hints...
> >
> >when I was trying to get something to work I had tried the following 8
> >type code...
> >
> >include_url($target_url,-POSTParams = $json_string, -sendmimeheaders =
> >array('Content-Type'='application/json','X-HTTP-Method-Override'='DELETE')
> >, -verifypeer=true, -string=true, -username='****',-password=*****')
> >
> >Very best regards,
> >
> >Rick
> >
> >-----Original Message-----
> >From: [hidden email]
> >[mailto:[hidden email]] On Behalf Of Steffan A. Cline
> >Sent: Monday, 6 May 2013 3:53 PM
> >To: Lasso Talk
> >Subject: Lasso 8: Include_URL and DELETE
> >
> >Is there anyway to force include_url to send DELETE rather than post?
> >
> >I need to emulate :
> >
> >curl https://my.url/12345 \
> >   -u username:password \
> >   -X DELETE
> >
> >
> >
> >
> >Thanks
> >
> >Steffan
> >
> >---------------------------------------------------------------
> >T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
> >Steffan A. Cline             [hidden email]
> >http://www.ExecuChoice.net                 Phoenix, Arizona USA
> >                  
> >---------------------------------------------------------------
> >
> >
> >
> >
> >
> >
> >#############################################################
> >
> >Attend the Lasso Developer Conference 2013!
> >Sept 12-14, 2013 in Niagara Falls, Canada
> >http://www.lassosoft.com/LDC-niagara-falls-2013
> >
> >#############################################################
> >This message is sent to you because you are subscribed to
> >  the mailing list Lasso
> >[hidden email]
> >To unsubscribe, E-mail to: <[hidden email]>
> >Send administrative queries to  <[hidden email]>
> >
> >
> >
> >
> >#############################################################
> >
> >Attend the Lasso Developer Conference 2013!
> >Sept 12-14, 2013 in Niagara Falls, Canada
> >http://www.lassosoft.com/LDC-niagara-falls-2013
> >
> >#############################################################
> >This message is sent to you because you are subscribed to
> >  the mailing list Lasso
> >[hidden email]
> >To unsubscribe, E-mail to: <[hidden email]>
> >Send administrative queries to  <[hidden email]>
> >
>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


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

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8: Include_URL and DELETE

Tim Taplin
I have a rest_request tag that I developed for the googlecal_api which handles requests such as this. It is a bit rough around the edges but I'd be happy to pass a copy over for you to polish up or at least give you some ideas on where to start.

Tim Taplin

On May 6, 2013, at 1:13 AM, Steve Piercy - Web Site Builder <[hidden email]> wrote:

> Why not use shell or os_process to issue a curl command?
>
> --steve
>
>
> On 5/5/13 at 11:46 PM, [hidden email] (Steffan A. Cline) pronounced:
>
>> I saw that thread but this is definitely Lasso 8.
>>
>> I have it working using NET tags to emulate curl but was hoping for
>> something I'm missing in L8.
>>
>> Thanks
>>
>> Steffan
>>
>> ---------------------------------------------------------------
>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>> Steffan A. Cline              [hidden email]
>> http://www.ExecuChoice.net                 Phoenix, Arizona USA
>>
>> ---------------------------------------------------------------
>>
>>
>>
>>
>>
>>
>> On 5/5/13 11:38 PM, "Rick Draper" <[hidden email]> wrote:
>>
>>> Hi Steffan,
>>>
>>> I know from the subject line this is 8, but in 9 we have used...
>>>
>>> include_url('http://dev.local/test.lasso?a=&b=2',
>>> -options=array(CURLOPT_CUSTOMREQUEST='DELETE'))
>>>
>>> not sure if that gives any hints...
>>>
>>> when I was trying to get something to work I had tried the following 8
>>> type code...
>>>
>>> include_url($target_url,-POSTParams = $json_string, -sendmimeheaders =
>>> array('Content-Type'='application/json','X-HTTP-Method-Override'='DELETE')
>>> , -verifypeer=true, -string=true, -username='****',-password=*****')
>>>
>>> Very best regards,
>>>
>>> Rick
>>>
>>> -----Original Message-----
>>> From: [hidden email]
>>> [mailto:[hidden email]] On Behalf Of Steffan A. Cline
>>> Sent: Monday, 6 May 2013 3:53 PM
>>> To: Lasso Talk
>>> Subject: Lasso 8: Include_URL and DELETE
>>>
>>> Is there anyway to force include_url to send DELETE rather than post?
>>>
>>> I need to emulate :
>>>
>>> curl https://my.url/12345 \
>>>  -u username:password \
>>>  -X DELETE
>>>
>>>
>>>
>>>
>>> Thanks
>>>
>>> Steffan
>>>
>>> ---------------------------------------------------------------
>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>> Steffan A. Cline             [hidden email]
>>> http://www.ExecuChoice.net                 Phoenix, Arizona USA
>>>
>>> ---------------------------------------------------------------
>>>
>>>
>>>
>>>
>>>
>>>
>>> #############################################################
>>>
>>> Attend the Lasso Developer Conference 2013!
>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>>
>>>
>>> #############################################################
>>>
>>> Attend the Lasso Developer Conference 2013!
>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


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

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso 8: Include_URL and DELETE

Tim Taplin
Here's the tag, perhaps it will be useful for others as well.
I used several reference points, Jason Huck's shell tag on tagswap, the lasso 9 implementation of include_url and some online curl tutorials.

I would think that you may wish to use a slightly different method for setting up the permissions for the os_process user. Either the tag could be called within a permissioned inline or you may have some other method in your setup to provide access to such authentication.

I'm planning to release the googlecal_api tagset as an open source project soon, but need to make the time to clean up a bit so that its ready to be worked on. Currently, we've got just the few functions needed to setup a calendar and post events to a calendar. So, it includes a google_auth tag for google's OAuth2 implementation that they use for their API's as well as as custom calendar, calendarlist and event objects for the calendars in addition to the more general Google Calendar API object.

That being said, I'd welcome thoughts, feedback or improvements to the rest_request tag below which is needed for the Lasso8 version of the api.



        define_tag('rest_request', -required='method', -required='url', -optional='rest_headers', -optional='request_body');
               
                local('cmd' = 'curl');
                #cmd +=(' -X '+#method);
                if(local_defined('rest_headers'));
                        local('header_string' = '');
                        iterate(#rest_headers, local('header'));
                                #header_string+=(#header->first+':'+#header->second+'\r\n');
                        /iterate;
                        #header_string->removetrailing('\r\n');
                       
                        #cmd +=(' -H "'+#header_string+'"');
                       
                /if;
                if(local_defined('request_body'));
                        #cmd +=(' -d \''+#request_body+'\'');
                /if;
                #cmd +=(' '+#url);
                inline(-username="os_process_user", -password="os_process_pass");
                        local('curl_rest' = os_process(
                                '/bin/bash',
                                (: '-c', 'cd /;' + #cmd)));
                     local('response' = #curl_rest->read);
                     #curl_rest->close;
             /inline;
             return(#response);
        /define_tag;
On May 6, 2013, at 5:50 AM, Tim Taplin <[hidden email]> wrote:

> I have a rest_request tag that I developed for the googlecal_api which handles requests such as this. It is a bit rough around the edges but I'd be happy to pass a copy over for you to polish up or at least give you some ideas on where to start.
>
> Tim Taplin
>
> On May 6, 2013, at 1:13 AM, Steve Piercy - Web Site Builder <[hidden email]> wrote:
>
>> Why not use shell or os_process to issue a curl command?
>>
>> --steve
>>
>>
>> On 5/5/13 at 11:46 PM, [hidden email] (Steffan A. Cline) pronounced:
>>
>>> I saw that thread but this is definitely Lasso 8.
>>>
>>> I have it working using NET tags to emulate curl but was hoping for
>>> something I'm missing in L8.
>>>
>>> Thanks
>>>
>>> Steffan
>>>
>>> ---------------------------------------------------------------
>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>> Steffan A. Cline              [hidden email]
>>> http://www.ExecuChoice.net                 Phoenix, Arizona USA
>>>
>>> ---------------------------------------------------------------
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 5/5/13 11:38 PM, "Rick Draper" <[hidden email]> wrote:
>>>
>>>> Hi Steffan,
>>>>
>>>> I know from the subject line this is 8, but in 9 we have used...
>>>>
>>>> include_url('http://dev.local/test.lasso?a=&b=2',
>>>> -options=array(CURLOPT_CUSTOMREQUEST='DELETE'))
>>>>
>>>> not sure if that gives any hints...
>>>>
>>>> when I was trying to get something to work I had tried the following 8
>>>> type code...
>>>>
>>>> include_url($target_url,-POSTParams = $json_string, -sendmimeheaders =
>>>> array('Content-Type'='application/json','X-HTTP-Method-Override'='DELETE')
>>>> , -verifypeer=true, -string=true, -username='****',-password=*****')
>>>>
>>>> Very best regards,
>>>>
>>>> Rick
>>>>
>>>> -----Original Message-----
>>>> From: [hidden email]
>>>> [mailto:[hidden email]] On Behalf Of Steffan A. Cline
>>>> Sent: Monday, 6 May 2013 3:53 PM
>>>> To: Lasso Talk
>>>> Subject: Lasso 8: Include_URL and DELETE
>>>>
>>>> Is there anyway to force include_url to send DELETE rather than post?
>>>>
>>>> I need to emulate :
>>>>
>>>> curl https://my.url/12345 \
>>>> -u username:password \
>>>> -X DELETE
>>>>
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> Steffan
>>>>
>>>> ---------------------------------------------------------------
>>>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>>>> Steffan A. Cline             [hidden email]
>>>> http://www.ExecuChoice.net                 Phoenix, Arizona USA
>>>>
>>>> ---------------------------------------------------------------
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> Attend the Lasso Developer Conference 2013!
>>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso
>>>> [hidden email]
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> Attend the Lasso Developer Conference 2013!
>>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso
>>>> [hidden email]
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>>
>>>
>>> #############################################################
>>>
>>> Attend the Lasso Developer Conference 2013!
>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


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

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>