[squeak-dev] https & woocommerce; basicAuth etc?
ron at usmedrec.com
Mon Oct 1 21:53:50 UTC 2018
Woohoo, what does he win Jonny'O!
On Mon, Oct 1, 2018 at 5:45 PM tim Rowledge <tim at rowledge.org> wrote:
> Yay! Winner!
> > On 2018-10-01, at 2:30 PM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> > On Mon, 1 Oct 2018, tim Rowledge wrote:
> >> I suspect I can make up a way to do a more direct use-auth-first-time
> approach that might be better when you know it has to have it. After my
> frog pills...
> > Yes you can. You just have to add the Authorization header yourself.
> Adding basic auth manually to the example in help would look something like
> > | client username password response |
> > client := WebClient new.
> > username := 'Tim'.
> > password := 'secret'.
> > response := client httpGet: 'http://www.squeak.org/protected' do:
> [ :request |
> > request headerAt: 'Authorization' put: 'Basic ',
> (username, ':', password) base64Encoded ].
> > response content. "Prefetch response body before closing the
> > client close. "Do not let WebClient instances leak external
> > ^response
> I saw the httpGet:do: but hadn't a clue how to assemble the header bit.
> Thank you!
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Law of Logical Argument: Anything is possible if you don't know what you
> are talking about.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev