Re: Communicate with server using PUT
On 27/06/2013 06:06, J. Landman Gay wrote: If we ever get the authentication worked out, I'm still not sure how to do a PUT. I'll try putting the data back into the variable and send that. Hi Jacque, Are you able to watch your network traffic, eg using WireShark? I've often found this was the quickest way to figure out what was going wrong with a network issue with LiveCode - especially if I have the benefit of an alternative that worked, so I can see exactly what is sent in a request that works, and what's been sent by LiveCode that doesn't work? FWIW, this is what LiveCode (or rather, LibURL) sends across the network for the following LiveCode commands put URL http://www.google.com/test/?x=123; into x GET /test/?x=123 HTTP/1.1 Host: www.google.com User-Agent: LiveCode (MacOS) post 123 to URL http://www.google.com/test/; POST /test/ HTTP/1.1 Host: www.google.com User-Agent: LiveCode (MacOS) Content-Length: 3 Content-Type: application/x-www-form-urlencoded 123 put 123 into URL http://www.google.com/test/; PUT /test/ HTTP/1.1 Host: www.google.com User-Agent: LiveCode (MacOS) Content-Length: 3 Content-Type: application/x-www-form-urlencoded 123 ... but really the interesting question is what the request (and response) look like when your server person does it from Rails. Ben ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On Thu, Jun 27, 2013 at 1:06 AM, J. Landman Gay jac...@hyperactivesw.comwrote: If we ever get the authentication worked out, I'm still not sure how to do a PUT. I'll try putting the data back into the variable and send that. put empty into url http://domain.com/page.xxx?**value1=onevalue2=twohttp://domain.com/page.xxx?value1=onevalue2=two should work fine. You can use query strings in POST, DELETE, GET or PUT. The query string is just part of the URL you are sending. Rails will parse what is in the query string and make those variables available to the Rails app. Your issue seems to be purely authorization related at this point. If you get stuck figuring out authorization let me know. If the URL is https then I wouldn't be surprised if you could just use BASIC AUTH in the header since all of the data is encrypted. -- Trevor DeVore Blue Mango Learning Systems www.clarify-it.com-www.screensteps.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
I have had trouble with PUT. I worked with the ISP to make sure it was enabled. I set up the right access file permissions. I made sure to put the name and password in the URL. And failure. So, either there was some overriding setting at the ISP that blocked things or either me or liburl is broken. I'm trying to remember what file was needed in the folder for the file to be PUT. I can look for it. Dar On Jun 26, 2013, at 4:48 PM, J. Landman Gay wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
Case location put revxmlnodecontents(txml,GeocodeResponse/result/geometry/nodename/lat) into geo[Lat][Center] put revxmlnodecontents(txml,GeocodeResponse/result/geometry/nodename/lng) into geo[Lon][Center] break Case location_type put revxmlnodecontents(txml,GeocodeResponse/result/geometry/nodename) into geo[LocationType] replace RANGE_ with empty in geo[LocationType] break Case viewport put revXMLChildNames(txml,/GeocodeResponse/result/geometry/nodename,comma,,fa lse) into str2 repeat for each item vp in str2 put revxmlnodecontents(txml,GeocodeResponse/result/geometry/nodenameslashvp /lat) into geo[Lat][vp] put revxmlnodecontents(txml,GeocodeResponse/result/geometry/nodenameslashvp /lng) into geo[Lon][vp] end repeat break end switch end repeat end if --breakpoint return geo end GeoCode Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of J. Landman Gay Sent: Wednesday, June 26, 2013 7:23 PM To: How to use LiveCode Subject: Re: Communicate with server using PUT When I use the full URL with get url it returns a 404. When the server person does it from Rails, they get data back. I need to get the same data back, so I guess checking the headers won't work. The server responds with stuff I need to use. So if get URL is the way to do it, then the get should give me the data. The 404 is odd, but maybe we can figure out that part. On 6/26/13 6:11 PM, Monte Goulding wrote: Should be the latter... what's the error? On 27/06/2013, at 9:07 AM, J. Landman Gay jac...@hyperactivesw.com wrote: That's an idea, thanks. I'm having trouble actually doing the PUT. I need to send a string like this: http://domain.com/page?thing=oneother=twosomethingelse=three What's the proper way to format that? Should I be using this: put thing=oneother=twosomethingelse=three into url http://domain.com/page; Or should I use get URL with the full URL? Both ways are returning errors. On 6/26/13 5:53 PM, Monte Goulding wrote: you should be able to check the libURLLastRHHeaders.. unless you are talking about mobile... actually there's no put on mobile anyway... On 27/06/2013, at 8:48 AM, J. Landman Gay jac...@hyperactivesw.com wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
RE: Communicate with server using PUT
I apologize for being lazy but I have used the CSZ acronym for 20 years. It stands for City State Zip. I found that just sending the zip yields the best results. Examples: put GeoCode(455 Park Ave suite 4401 , 10011) into Geo put GeoCode(54 Main Street , 12801) into Geo GeoCode returns an array with the these keys: [Lat][Center] [Lon[Center] [Status] [LocationType] [PartialMatch] Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Thomas McGrath III Sent: Thursday, June 27, 2013 10:07 AM To: How to use LiveCode Subject: Re: Communicate with server using PUT Ralph, I'm trying to learn about the Google api and understand your code and wanted to know what is expected in CSZ to feed to this function? what is your typical line of code that calls this function? Thanks -- Tom McGrath III http://lazyriver.on-rev.com mcgra...@mac.com On Jun 26, 2013, at 8:03 PM, Ralph DiMola rdim...@evergreeninfo.net wrote: J, Well I guess no attachments on the list. Here it is in-line. function GeoCode StreetAddress , CSZ --Status Codes --OK indicates that no errors occurred; the address was successfully parsed and at least one geocode was returned. --ZERO_RESULTS indicates that the geocode was successful but returned no results. This may occur if the geocode was passed a non-existent address or a latlng in a remote location. --OVER_QUERY_LIMIT indicates that you are over your quota. --REQUEST_DENIED indicates that your request was denied, generally because of lack of a sensor parameter. --INVALID_REQUESTgenerally indicates that the query (address or latlng) is missing --Location Types --ROOFTOP indicates that the returned result is a precise geocode for which we have location information accurate down to street -- address precision. --RANGE_INTERPOLATED indicates that the returned result reflects an approximation (usually on a road) interpolated between two --precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable --for a street address. --GEOMETRIC_CENTER indicates that the returned result is the geometric center of a result such as a polyline (for example, a street) --or polygon (region). --APPROXIMATE indicates that the returned result is approximate local gxml , txml , str1 , pos1 , add1 , I , str2 Local Geo put empty into Geo repeat with I = 1 to the number of lines in StreetAddress put offset (#,line I of StreetAddress) into pos1 if pos1 0 then put char 1 to (pos1-1) of line I of StreetAddress into line I of Streetaddress Replacewith in line I of StreetAddress replace with + in line I of StreetAddress put Add1 Line I of Streetaddress into Add1 end repeat delete char 1 in Add1 Replacewith in CSZ replace with + in CSZ put url (http://maps.googleapis.com/maps/api/geocode/xml?address=; add1 comma + CSZ sensor=false) into gxml delete line 1 in gxml put revCreateXMLTree(gxml,true,true,false) into txml put revxmlnodecontents(txml,GeocodeResponse/status) into geo[Status] replace OVER_ with in geo[Status] if revxmlnodecontents(txml,GeocodeResponse/status) = OK then if xmlnodecontents(txml,GeocodeResponse/result/formatted_address) is not empty then \ put xmlnodecontents(txml,GeocodeResponse/result/formatted_address) into Geo[FormattedAddress] put xmlnodecontents(txml,GeocodeResponse/result/partial_match) into Geo[PartialMatch] repeat with I = 1 to revxmlnumberofchildren(txml,/GeocodeResponse/result,address_component,1) switch revxmlnodecontents(txml,GeocodeResponse/result/address_component[ I ]/type) Case administrative_area_level_2 put revxmlnodecontents(txml,GeocodeResponse/result/address_component[ I ]/long_name) into geo[County] Break Case administrative_area_level_3 put revxmlnodecontents(txml,GeocodeResponse/result/address_component[ I ]/long_name) into geo[City] Break Case street_number put revxmlnodecontents(txml,GeocodeResponse/result/address_component[ I ]/long_name) into geo[StreetNumber] Break Case route put revxmlnodecontents(txml,GeocodeResponse/result/address_component[ I ]/long_name) into geo[Route] Break Case locality put revxmlnodecontents(txml,GeocodeResponse/result/address_component[ I ]/long_name) into geo[City] Break Case administrative_area_level_1 put revxmlnodecontents(txml,GeocodeResponse/result/address_component[ I ]/long_name) into geo[StateName] put
Re: Communicate with server using PUT
On Thu, Jun 27, 2013 at 10:00 AM, Dar Scott d...@swcp.com wrote: I have had trouble with PUT. I worked with the ISP to make sure it was enabled. I set up the right access file permissions. I made sure to put the name and password in the URL. And failure. So, either there was some overriding setting at the ISP that blocked things or either me or liburl is broken. Dar, I've used libURL for years to send PUT calls to my servers so I don't think it is libURL. It is the call used whenever you are updating a resource on the server. I recall that a few years ago I had to mimic PUT by doing a POST with a parameter specifying that the server should process as a PUT. This was a ruby on rails issue IIRC, however. -- Trevor DeVore Blue Mango Learning Systems www.clarify-it.com-www.screensteps.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 27/06/2013 14:28, Mike Bonner wrote: I think a put and a post are very similar. You might manually set the headers to work as a put but us post to send the data. (think the data comes through the same way, its just the headers that differ) I don't think that's needed - LiveCode's PUT mechanism works fine. The difference in the headers _is_ the difference: the point of the spec is that PUT means something different to POST (in POST, the resource specified in the URL is supposed to handle the data, process it in some way, possibly return some result - so for example, if that resource doesn't exist, that's an error; in PUT, the URL specifies where the data should go - if there's nothing there now, that's fine. PUT is the inverse of GET. POST is something different altogether.) But of course anyone can implement a server to interpret requests in any way. (Whether the data is encoded the way that the service expects is another issue - ie the way that LibURL is defaulting to encoding it. But that should be defined by the service.) Ben ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
Thanks everyone, the problem is solved. It was indeed an authorization problem and once I fixed that, PUT started working. We are using a token to identify the app, and a bad copy/paste caused it to be missing a digit. All that trouble over a single integer. Right now I'm putting the data into a variable and putting that into the http URL. I get a response back in the urlResponse, just as it should be. I'm grateful for the info about urlResponse, I haven't had to use it before and didn't know it existed. I haven't tried just appending the value pairs to the end of the URL because now that it works, I don't want to mess with it. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
J. Landman Gay jacque@... writes: All that trouble over a single integer. Thanks to SCOTUS, single integers can now get married. -- Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
This is coming back to me and I think I ended up testing the PUT on a different server. Perhaps some Apache setting was getting in the way and the ISP was not able to track it down. I still wonder if my test had some flaw staring me in the face. In any case, I was able to do the test. Dar On Jun 27, 2013, at 8:46 AM, Trevor DeVore wrote: On Thu, Jun 27, 2013 at 10:00 AM, Dar Scott d...@swcp.com wrote: I have had trouble with PUT. I worked with the ISP to make sure it was enabled. I set up the right access file permissions. I made sure to put the name and password in the URL. And failure. So, either there was some overriding setting at the ISP that blocked things or either me or liburl is broken. Dar, I've used libURL for years to send PUT calls to my servers so I don't think it is libURL. It is the call used whenever you are updating a resource on the server. I recall that a few years ago I had to mimic PUT by doing a POST with a parameter specifying that the server should process as a PUT. This was a ruby on rails issue IIRC, however. -- Trevor DeVore Blue Mango Learning Systems www.clarify-it.com-www.screensteps.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
you should be able to check the libURLLastRHHeaders.. unless you are talking about mobile... actually there's no put on mobile anyway... On 27/06/2013, at 8:48 AM, J. Landman Gay jac...@hyperactivesw.com wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
That's an idea, thanks. I'm having trouble actually doing the PUT. I need to send a string like this: http://domain.com/page?thing=oneother=twosomethingelse=three What's the proper way to format that? Should I be using this: put thing=oneother=twosomethingelse=three into url http://domain.com/page; Or should I use get URL with the full URL? Both ways are returning errors. On 6/26/13 5:53 PM, Monte Goulding wrote: you should be able to check the libURLLastRHHeaders.. unless you are talking about mobile... actually there's no put on mobile anyway... On 27/06/2013, at 8:48 AM, J. Landman Gay jac...@hyperactivesw.com wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
Should be the latter... what's the error? On 27/06/2013, at 9:07 AM, J. Landman Gay jac...@hyperactivesw.com wrote: That's an idea, thanks. I'm having trouble actually doing the PUT. I need to send a string like this: http://domain.com/page?thing=oneother=twosomethingelse=three What's the proper way to format that? Should I be using this: put thing=oneother=twosomethingelse=three into url http://domain.com/page; Or should I use get URL with the full URL? Both ways are returning errors. On 6/26/13 5:53 PM, Monte Goulding wrote: you should be able to check the libURLLastRHHeaders.. unless you are talking about mobile... actually there's no put on mobile anyway... On 27/06/2013, at 8:48 AM, J. Landman Gay jac...@hyperactivesw.com wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
When I use the full URL with get url it returns a 404. When the server person does it from Rails, they get data back. I need to get the same data back, so I guess checking the headers won't work. The server responds with stuff I need to use. So if get URL is the way to do it, then the get should give me the data. The 404 is odd, but maybe we can figure out that part. On 6/26/13 6:11 PM, Monte Goulding wrote: Should be the latter... what's the error? On 27/06/2013, at 9:07 AM, J. Landman Gay jac...@hyperactivesw.com wrote: That's an idea, thanks. I'm having trouble actually doing the PUT. I need to send a string like this: http://domain.com/page?thing=oneother=twosomethingelse=three What's the proper way to format that? Should I be using this: put thing=oneother=twosomethingelse=three into url http://domain.com/page; Or should I use get URL with the full URL? Both ways are returning errors. On 6/26/13 5:53 PM, Monte Goulding wrote: you should be able to check the libURLLastRHHeaders.. unless you are talking about mobile... actually there's no put on mobile anyway... On 27/06/2013, at 8:48 AM, J. Landman Gay jac...@hyperactivesw.com wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
Jacques Is page in your URL example a folder or a file? If it is a folder then I am pretty sure it needs a slash after it. Regards Matthias Von meinem iPhone gesendet Am 27.06.2013 um 01:22 schrieb J. Landman Gay jac...@hyperactivesw.com: When I use the full URL with get url it returns a 404. When the server person does it from Rails, they get data back. I need to get the same data back, so I guess checking the headers won't work. The server responds with stuff I need to use. So if get URL is the way to do it, then the get should give me the data. The 404 is odd, but maybe we can figure out that part. On 6/26/13 6:11 PM, Monte Goulding wrote: Should be the latter... what's the error? On 27/06/2013, at 9:07 AM, J. Landman Gay jac...@hyperactivesw.com wrote: That's an idea, thanks. I'm having trouble actually doing the PUT. I need to send a string like this: http://domain.com/page?thing=oneother=twosomethingelse=three What's the proper way to format that? Should I be using this: put thing=oneother=twosomethingelse=three into url http://domain.com/page; Or should I use get URL with the full URL? Both ways are returning errors. On 6/26/13 5:53 PM, Monte Goulding wrote: you should be able to check the libURLLastRHHeaders.. unless you are talking about mobile... actually there's no put on mobile anyway... On 27/06/2013, at 8:48 AM, J. Landman Gay jac...@hyperactivesw.com wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
put theData into URL http://somedomain.com/page.php?value1=valuevalue2=value; The above will send data to a server using PUT. The result will return error messages. If you want data returned by the server use the urlresponse. -- Trevor DeVore On Wednesday, June 26, 2013, J. Landman Gay wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com __**_ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
RE: Communicate with server using PUT
[LocationType] replace RANGE_ with empty in geo[LocationType] break Case viewport put revXMLChildNames(txml,/GeocodeResponse/result/geometry/nodename,comma,,fa lse) into str2 repeat for each item vp in str2 put revxmlnodecontents(txml,GeocodeResponse/result/geometry/nodenameslashvp /lat) into geo[Lat][vp] put revxmlnodecontents(txml,GeocodeResponse/result/geometry/nodenameslashvp /lng) into geo[Lon][vp] end repeat break end switch end repeat end if --breakpoint return geo end GeoCode Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of J. Landman Gay Sent: Wednesday, June 26, 2013 7:23 PM To: How to use LiveCode Subject: Re: Communicate with server using PUT When I use the full URL with get url it returns a 404. When the server person does it from Rails, they get data back. I need to get the same data back, so I guess checking the headers won't work. The server responds with stuff I need to use. So if get URL is the way to do it, then the get should give me the data. The 404 is odd, but maybe we can figure out that part. On 6/26/13 6:11 PM, Monte Goulding wrote: Should be the latter... what's the error? On 27/06/2013, at 9:07 AM, J. Landman Gay jac...@hyperactivesw.com wrote: That's an idea, thanks. I'm having trouble actually doing the PUT. I need to send a string like this: http://domain.com/page?thing=oneother=twosomethingelse=three What's the proper way to format that? Should I be using this: put thing=oneother=twosomethingelse=three into url http://domain.com/page; Or should I use get URL with the full URL? Both ways are returning errors. On 6/26/13 5:53 PM, Monte Goulding wrote: you should be able to check the libURLLastRHHeaders.. unless you are talking about mobile... actually there's no put on mobile anyway... On 27/06/2013, at 8:48 AM, J. Landman Gay jac...@hyperactivesw.com wrote: I need to send data to a server and they want me to use PUT instead of POST. I also need to get a verification afterward to know whether the transaction succeeded or not. The docs aren't clear on that, it just says errors are reported in the result. Before I spend too much time on this, does a PUT also provide a response in the result? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Monte Goulding M E R Goulding - software development services mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 6/26/13 6:43 PM, Matthias Rebbe wrote: Jacques Is page in your URL example a folder or a file? If it is a folder then I am pretty sure it needs a slash after it. It's a file, I left off the suffix because it's a custom one and I didn't want to have to explain it. :) -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 6/26/13 6:52 PM, Trevor DeVore wrote: put theData into URL http://somedomain.com/page.php?value1=valuevalue2=value; The above will send data to a server using PUT. The result will return error messages. If you want data returned by the server use the urlresponse. That's how I first started, using put, but I think I had the content wrong. What goes into theData? In this case, the parameter values are the data. Should I just do put empty into url http://blah blah? The urlresponse is just what I was looking for, thanks much for that. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 6/26/13 7:03 PM, Ralph DiMola wrote: J, Well I guess no attachments on the list. Here it is in-line. function GeoCode StreetAddress , CSZ Thanks. I actually have the parameters formatted, I'm just not having any luck with the PUT business. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
Jacque On 27 Jun 2013, at 09:33, J. Landman Gay wrote: That's how I first started, using put, but I think I had the content wrong. What goes into theData? In this case, the parameter values are the data. Should I just do put empty into url http://blah blah? I didn't think that the HTTP specification allowed for query strings with the POST or PUT methods. If they do, it is most unusual. Have you tried putting the query string (without the ?) into theData and removing it from the url? Regards Peter http://LiveCode1001.blogspot.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 6/26/13 9:09 PM, Peter W A Wood wrote: Jacque On 27 Jun 2013, at 09:33, J. Landman Gay wrote: That's how I first started, using put, but I think I had the content wrong. What goes into theData? In this case, the parameter values are the data. Should I just do put empty into url http://blah blah? I didn't think that the HTTP specification allowed for query strings with the POST or PUT methods. If they do, it is most unusual. Have you tried putting the query string (without the ?) into theData and removing it from the url? A browser can send http URLs with query strings, and I think that's a PUT. When using POST we format the content as query strings too, and I have that working. But I wondered the same thing about PUT, so I was originally putting the values into theData. That didn't work so I tried it Trevor's way. I get errors in either case. The URL does exist, Rails can PUT to it and get data back, so I'm not sure about the 404 error. Error 401 is a bad format error. So far, I've tried: put value1=onevalue2=two into tData put tData into url http://domain.com/page.xxx - result: Error 401 - urlResponse: empty put test into url http://domain.com/page.xxx?value1=onevalue2=two; (also tried putting empty into the same URL) - result: Error 401 - urlResponse: empty get url http://domain.com/page.xxx?value1=onevalue2=two; - it: Error 404 There may be something wrong with my actual parameters. Some of them are bracketed like this: thing[id]=1234thing[name]=Sally But it seems like that shouldn't matter. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 27/06/2013, at 12:45 PM, J. Landman Gay wrote: Error 401 is a bad format error. It's unauthorized... are you meant to send credentials... http://username:pass@ -- M E R Goulding Software development services Bespoke application development for vertical markets mergExt - There's an external for that! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 6/26/13 10:39 PM, Monte Goulding wrote: On 27/06/2013, at 12:45 PM, J. Landman Gay wrote: Error 401 is a bad format error. It's unauthorized... are you meant to send credentials... http://username:pass@ Oh gosh, I shouldn't rely on my memory. I'll ask them. It figures the server people could access it. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 6/26/13 7:45 PM, J. Landman Gay wrote: On 6/26/13 9:09 PM, Peter W A Wood wrote: Jacque On 27 Jun 2013, at 09:33, J. Landman Gay wrote: That's how I first started, using put, but I think I had the content wrong. What goes into theData? In this case, the parameter values are the data. Should I just do put empty into url http://blah blah? I didn't think that the HTTP specification allowed for query strings with the POST or PUT methods. If they do, it is most unusual. Have you tried putting the query string (without the ?) into theData and removing it from the url? A browser can send http URLs with query strings, and I think that's a PUT. It's a GET. If you try this, you'll see $REQUEST_METHOD = GET: http://pdslabs.net/rev/globals.cgi?first=1second=2 That's all I have. :-) Phil When using POST we format the content as query strings too, and I have that working. But I wondered the same thing about PUT, so I was originally putting the values into theData. That didn't work so I tried it Trevor's way. I get errors in either case. The URL does exist, Rails can PUT to it and get data back, so I'm not sure about the 404 error. Error 401 is a bad format error. So far, I've tried: put value1=onevalue2=two into tData put tData into url http://domain.com/page.xxx - result: Error 401 - urlResponse: empty put test into url http://domain.com/page.xxx?value1=onevalue2=two; (also tried putting empty into the same URL) - result: Error 401 - urlResponse: empty get url http://domain.com/page.xxx?value1=onevalue2=two; - it: Error 404 There may be something wrong with my actual parameters. Some of them are bracketed like this: thing[id]=1234thing[name]=Sally But it seems like that shouldn't matter. -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Communicate with server using PUT
On 6/26/13 11:59 PM, Phil Davis wrote: On 6/26/13 7:45 PM, J. Landman Gay wrote: A browser can send http URLs with query strings, and I think that's a PUT. It's a GET. If you try this, you'll see $REQUEST_METHOD = GET: http://pdslabs.net/rev/globals.cgi?first=1second=2 That's all I have. :-) More than I have, apparently. I knew that. Then I forgot it. I've been staring at this stuff so long my brain hurts. If we ever get the authentication worked out, I'm still not sure how to do a PUT. I'll try putting the data back into the variable and send that. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode