[Prev][Next][Index][Thread]

Need help with exporting/processing GET and POST URLs in MAC-CL-HTTP



Greetings,

  I've been trying to use GET and POST URLs in MAC-CL-HTTP and have been
running into a number of stumbling blocks.  I'd really appreciate
any help that anyone could offer!

1. PROBLEM ONE -- GET

   I have this kind of working using a :search URL, but am having
   trouble accessing the "search-keys".  I suspect there may be a
   bug in the search-keys parser -- it seems to be splitting at
   #\+ characters which are encodings for space, rather than the
   #\& characters which separate the name=value "fields".  Please
   somebody correct me if I'm misunderstanding the syntax, as I'm
   still a rank neophyte at HTTP protocol.

Here is a (describe ...) of a search-url to illustrate:

***********************************************************
#<HTTP-SEARCH
http://ibappc.gte.com/cl-http/GlennTest/print-args-get?fullname%3Dthis+is+a+
test%26hiddenarg%3Dhidden+text%26submitname%3DSubmit+Query #x597F46E>
Class: #<STANDARD-CLASS URL:HTTP-SEARCH>
Wrapper: #<CCL::CLASS-WRAPPER URL:HTTP-SEARCH #x5899446>
Instance slots
URL:SEARCH-KEYS: ("fullname=this" "is" "a" "test&hiddenarg=hidden"
                  "text&submitname=Submit" "Query")
URL:SEARCH-DATABASE: NIL
URL:RESPONSE-FUNCTION: NIL
URL:PATH: ("cl-http" "GlennTest" "print-args-get")
URL:PORT: NIL
URL:HOST-STRING: "ibappc.gte.com"
URL:HOST-OBJECT: NIL
URL:EXPIRATION-FUNCTION: NIL
URL:SECURE-SUBNETS: NIL
URL:AUTHENTICATION-REALM: NIL
URL:CAPABILITIES: NIL
URL:TRANSLATION-METHOD: :SEARCH
URL:NAME-STRING:
"http://ibappc.gte.com/cl-http/GlennTest/print-args-get?fullname%3Dthis+is+a
+test%26hiddenarg%3Dhidden+text%26submitname%3DSubmit+Query"
URL:DISPLAY-STRING: NIL
HTTP::PLIST: (:SEARCH-PARENT
              #<HTTP-SEARCH
http://ibappc.gte.com/cl-http/GlennTest/print-args-get? #x592DDAE>)
Class slots
URL:SCHEME: "http"
***********************************************************

Here is what the URL looks like in the Netscape 3.0b4 location box:

http://ibappc/cl-http/GlennTest/print-args-get?fullname=this+is+a+test&hidde
narg=hidden+text&submitname=Submit+Query

I would have thought that search-keys would look like this:

("fullname=this is a test" "hiddenarg=hidden text" "submitname=Submit Query")

Is this a bug? Or am I missing something??



2. PROBLEM TWO - POST

  I'm trying to handle this with a :HTTP-FORM export, and can't
  get the export to run without error.  I couldn't find any examples
  of plain :HTTP-FORM in the "examples:exports.lisp" file.  Only
  examples of :HTTP-COMPUTED-FORM, which doesn't seem like what I want.

  Here's the export form I'm trying:

*************************************************
(export-url #u"/cl-http/GlennTest/post-test/print-args-post2.html"
            :http-form
            :response-function #'respond-by-printing-post-args
            :keywords '(:test :experiment)
            :expiration `(:interval ,(* 15. 60.))
            :documentation "Respond to URL by printing the args.  Is this
the CGI equivalent?")
*************************************************

  and the error it generates:

*************************************************
> Error: :HTTP-FORM is an unknown export-type for #<HTTP-OBJECT
>http://ibappc.gte.com/cl-http/GlennTest/post-test/print-args-post2.html
>#x597407E>.
> While executing: #<STANDARD-METHOD EXPORT-URL (T T)>
> Type Command-. to abort.
See the RestartsŠ menu item for further choices.
1 >
*************************************************

I've tried different names in place of "print-args-post2.html", such as
omitting the ".html", including a "?", but haven't succeeded.  Is this
broken, or am I missing some crucial point??

I'm using Mac-CL-HTTP-58-12 running in MCL-PPC 3.9 on a PowerMac 8100/80AV,
for what its worth.

PLEASE HELP!!!

Has anyone out there succeeded in getting these things to work??

Many thanks in advance!!
Glenn


-------------------------------------------------------------
Glenn A. Iba
GTE Laboratories
40 Sylvan Rd., MS-44
Waltham, MA 02254

e-mail: giba@gte.com
phone: 617-466-4233