Page 1 of 1
Any fluiddb examples available?
Posted: Sat Jan 29, 2011 4:29 pm
by jmarques
Could someone post some examples that access fluiddb? I am having trouble understanding how to setup basic http authentication using Livecode.
It is free both to sign up and use.
Re: Any fluiddb examples available?
Posted: Thu Feb 03, 2011 2:57 pm
by trevordevore
I don't have an example for using fluiddb but here is an example showing the use of basic http authentication in LiveCode. Perhaps it will help you figure out what you need to do for fluiddb.
Code: Select all
## Store current headers so they can be restored afterwards
put the httpheaders into theOrigHeaders
## Create new header
put "username" into theUser
put "password" into thePassword
put "Authorization: Basic " & base64Encode(theUser& ":" & thePassword ) & cr into theString
put "Content-Type: application/xml" & cr after theString
put "Accept: */*" after theString
## Set header
set the httpHeaders to theString
## Fetch url
put URL "http://some-url.com" into theData
## Restore headers
set the httpheaders to theOrigHeaders