|
23 | 23 | (defmethod connect (client)
|
24 | 24 | (lsquic:connect client))
|
25 | 25 |
|
26 |
| -(defmethod make-request (client &keys host port headers path body verb) |
27 |
| - (let* ((request (make-instance lsquic:request |
| 26 | +(defmethod make-request (client &key headers path body verb) |
| 27 | + (let* ((request (make-instance 'lsquic:request |
28 | 28 | :path path
|
29 | 29 | :headers headers
|
30 |
| - :authority host |
| 30 | + :authority (lsquic:host client) |
31 | 31 | :verb verb
|
32 | 32 | :body body))
|
33 | 33 | (pipe (lsquic:new-stream client request)))
|
|
36 | 36 | (defmacro request-no-body (verb)
|
37 | 37 | (let* ((sym-name (symbol-name verb))
|
38 | 38 | (method-name (intern (format nil "MAKE-~A-REQUEST" sym-name))))
|
39 |
| - `(defmethod ,method-name (client &keys host port headers path) |
40 |
| - (make-request |
41 |
| - client :host host :port port :headers header :body nil :verb ,verb)))) |
| 39 | + `(progn |
| 40 | + (defmethod ,method-name (client &key headers path) |
| 41 | + (make-request |
| 42 | + client :path path :headers headers :body nil :verb ,sym-name)) |
| 43 | + (export (quote ,method-name))))) |
42 | 44 |
|
43 | 45 | (defmacro request-with-body (verb)
|
44 | 46 | (let* ((sym-name (symbol-name verb))
|
45 | 47 | (method-name (intern (format nil "MAKE-~A-REQUEST" sym-name))))
|
46 |
| - `(defmethod ,method-name (client &keys host port headers path body) |
47 |
| - (make-request |
48 |
| - client :host host :port port :headers header :body body :verb ,verb)))) |
| 48 | + `(progn |
| 49 | + (defmethod ,method-name (client &keys headers path body) |
| 50 | + (make-request |
| 51 | + client :path path :headers headers :body body :verb ,sym-name)) |
| 52 | + (export (quote ,method-name))))) |
49 | 53 |
|
50 | 54 | (request-no-body get)
|
51 | 55 | (request-no-body head)
|
|
0 commit comments