Hi,
I need to upload a file using http with POST (and digest authentication), but I can't get my head around on how to do that. Other than opening a socket, and going all the way deep down..... But that doesn't look like LiveCode?
Also, is there a way to HTTP PUT, DELETE? You know, REST like intrefaces....
Any thoughts greatly appreciated.
--Maarten
http file upload/REST verbs
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 20
- Joined: Sun Dec 28, 2008 3:26 pm
-
- Posts: 65
- Joined: Thu Oct 07, 2010 4:47 pm
Re: http file upload/REST verbs
Take a look at this library, it's for SOAP based web services but might help you see some use examples that you can apply to the RESTful web services:
http://revonline2.runrev.com/stack/405/LibSOAP
http://revonline2.runrev.com/stack/405/LibSOAP
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: http file upload/REST verbs
In order to use Digest authentication you have to implement it yourself by means of libUrlSetAuthCallback. I've partially implemented Digest auth in the GLX Application Framework so you could extract the necessary handlers from the library. There are a couple of handlers involved so you will need to download the source in order to take a look.maarten.koopmans wrote:I need to upload a file using http with POST (and digest authentication), but I can't get my head around on how to do that. Other than opening a socket, and going all the way deep down..... But that doesn't look like LiveCode?
http://www.bluemangolearning.com/revolu ... framework/
In the distribution folder find the glxapp_framework.dat stack file. Open it in LiveCode and edit the "glxApplicationFramework" stack script. Search for "libUrlSetAuthCallback" and "glxappAuthDigestCallback". glxappAuthDigestCallback makes some calls to other handlers in the library stack such as _DigestAuthToken. You will want to replace the _GetCredentials call to something that returns the proper username/password as _GetCredentials uses some framework specific means to obtain a username/password.
maarten.koopmans wrote:Also, is there a way to HTTP PUT, DELETE? You know, REST like intrefaces....
Code: Select all
PUT: put aVariableWithData into URL theURL
Code: Select all
DELETE: delete URL theURL
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder