Skip to content

Commit

Permalink
Add redirect support for put and delete.
Browse files Browse the repository at this point in the history
  • Loading branch information
ober committed Feb 4, 2020
1 parent 6d4f568 commit f68cd9d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/std/net/request.ss
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,23 @@
(http-request 'POST url headers data [] redirect)))

(def (http-put url
redirect: (redirect #t)
headers: (headers #f)
cookies: (cookies #f)
params: (params #f)
data: (data #f))
(let ((url (url-target-e url params))
(headers (make-http/1.1-headers headers cookies)))
(http-request 'PUT url headers data [] #f)))
(http-request 'PUT url headers data [] redirect)))

(def (http-delete url
redirect: (redirect #t)
headers: (headers #f)
cookies: (cookies #f)
params: (params #f))
(let ((url (url-target-e url params))
(headers (make-http/1.1-headers headers cookies)))
(http-request 'DELETE url headers #f [] #f)))
(http-request 'DELETE url headers #f [] redirect)))

(def (http-options url
headers: (headers #f)
Expand Down

0 comments on commit f68cd9d

Please sign in to comment.