Re: [AOLSERVER] error with ns_httpget

2006-04-03 Thread Mark Aufflick
As visible on openacs.org api docs:

http://openacs.org/api-doc/proc-view?proc=util_httppostsource_p=1version_id=

In cvs head:

http://cvs.openacs.org/cvs/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl?rev=HEADview=auto



On 3/31/06, Titi Ala'ilima [EMAIL PROTECTED] wrote:
 ACS (Open, etc.) has a version of httpget called util_httpget, which
 allows a little more customization, i.e. allowing you to set headers.
 So the equivalent to putting the username and password into the URL is
 adding an Authorization header of the form Basic $token where token
 is username:password base64 encoded.  So here is what I do:

 set url
 http://geocoder.us/member/service/csv/geocode?address=$address,+$city+$state+$zip;
 package require base64
 set headers [ns_set create]
 ns_set put $headers Authorization Basic [base64::encode
 username:password]
 set result [util_httpget $url $headers]

 I don't have a recent version of util_httpget so there might be some
 improvements in recent versions.  If you want though, I can send you a
 copy of the version I have.

 -T.


 Thorpe Mayes wrote:
  I am trying to go here:
 
  ns_httpget http://username:[EMAIL 
  PROTECTED]/member/service/csv/geocode?address=
  $newaddress,+$newcity+$state
 
  and am getting this error message:
 
  Error: expected integer but got [EMAIL PROTECTED]
  expected integer but got [EMAIL PROTECTED]
  while executing
  ns_sockopen -nonblock $host $port
  (procedure ns_httpopen line 11)
  invoked from within
  ns_httpopen GET $url  $timeout
  (procedure ns_httpget line 5)
  invoked from within
  ns_httpget http://username:[EMAIL 
  PROTECTED]/member/service/csv/geocode?address=
  $newaddress,+$newcity+$state
 
 
  Is there a work-around?
 
  Thank you.
 
  Thorpe
 
 
  --
  AOLserver - http://www.aolserver.com/
 
  To Remove yourself from this list, simply send an email to [EMAIL 
  PROTECTED] with the
  body of SIGNOFF AOLSERVER in the email message. You can leave the 
  Subject: field of your email blank.
 


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an email to [EMAIL 
 PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
 field of your email blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


[AOLSERVER] error with ns_httpget

2006-03-30 Thread Thorpe Mayes
I am trying to go here:

ns_httpget http://username:[EMAIL 
PROTECTED]/member/service/csv/geocode?address=
$newaddress,+$newcity+$state

and am getting this error message:

Error: expected integer but got [EMAIL PROTECTED]
expected integer but got [EMAIL PROTECTED]
while executing
ns_sockopen -nonblock $host $port
(procedure ns_httpopen line 11)
invoked from within
ns_httpopen GET $url  $timeout
(procedure ns_httpget line 5)
invoked from within
ns_httpget http://username:[EMAIL 
PROTECTED]/member/service/csv/geocode?address=
$newaddress,+$newcity+$state


Is there a work-around?

Thank you.

Thorpe


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] error with ns_httpget

2006-03-30 Thread Bas Scheffers
Looks like some regexp failing on the username:password.

ns_httpopen (called by ns_httpget) doesn't know how to handle basic auth
at all.

You could try using the Tcl http package instead, but I don't know if it
does it:

http://tcl.tk/man/tcl8.4/TclCmd/http.htm

Otherwise you will have to hack ns_httpopen to support it and submit the
patch! it's in aolserver/modules/tcl/http.tcl

Cheers,
Bas.

Thorpe Mayes said:
 I am trying to go here:

 ns_httpget
 http://username:[EMAIL PROTECTED]/member/service/csv/geocode?address=
 $newaddress,+$newcity+$state

 and am getting this error message:

 Error: expected integer but got [EMAIL PROTECTED]
 expected integer but got [EMAIL PROTECTED]
 while executing
 ns_sockopen -nonblock $host $port
 (procedure ns_httpopen line 11)
 invoked from within
 ns_httpopen GET $url  $timeout
 (procedure ns_httpget line 5)
 invoked from within
 ns_httpget
 http://username:[EMAIL PROTECTED]/member/service/csv/geocode?address=
 $newaddress,+$newcity+$state


 Is there a work-around?

 Thank you.

 Thorpe


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an email to
 [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message. You can leave the
 Subject: field of your email blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] error with ns_httpget

2006-03-30 Thread Titi Ala'ilima
ACS (Open, etc.) has a version of httpget called util_httpget, which 
allows a little more customization, i.e. allowing you to set headers.  
So the equivalent to putting the username and password into the URL is 
adding an Authorization header of the form Basic $token where token 
is username:password base64 encoded.  So here is what I do:


set url 
http://geocoder.us/member/service/csv/geocode?address=$address,+$city+$state+$zip;

package require base64
set headers [ns_set create]
ns_set put $headers Authorization Basic [base64::encode 
username:password]

set result [util_httpget $url $headers]

I don't have a recent version of util_httpget so there might be some 
improvements in recent versions.  If you want though, I can send you a 
copy of the version I have.


-T.


Thorpe Mayes wrote:

I am trying to go here:

ns_httpget http://username:[EMAIL 
PROTECTED]/member/service/csv/geocode?address=
$newaddress,+$newcity+$state

and am getting this error message:

Error: expected integer but got [EMAIL PROTECTED]
expected integer but got [EMAIL PROTECTED]
while executing
ns_sockopen -nonblock $host $port
(procedure ns_httpopen line 11)
invoked from within
ns_httpopen GET $url  $timeout
(procedure ns_httpget line 5)
invoked from within
ns_httpget http://username:[EMAIL 
PROTECTED]/member/service/csv/geocode?address=
$newaddress,+$newcity+$state


Is there a work-around?

Thank you.

Thorpe


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.
  



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.