Why does this POST not match?

46 views
Skip to first unread message

larry google groups

unread,
Mar 17, 2013, 3:44:31 PM3/17/13
to comp...@googlegroups.com
My GET works fine, but the POST does not. Here are my routes:

larry google groups

unread,
Mar 17, 2013, 3:48:47 PM3/17/13
to comp...@googlegroups.com
 

My GET works fine, but the POST does not. Here are my routes:

(defroutes app-routes
  (ANY "/" request (home-page request))
  (GET "/raw_data" [] (raw_data))
  (GET "/account" request (account request))
  (GET "/login" request (login request))
  (GET "/start-over" request (start-over request))
  (GET "/admin" request (admin request))
  (GET "/admin/list/:item-type" [request item-type] (admin-list request item-type))
  (GET "/admin/edit/:item-type/:item-name" [request item-type item-name] (admin-edit request item-type (keyword item-name)))
  (POST "/admin/edit/:item-type/:item-name" [request item-type item-name] (admin-update request item-type (keyword item-name)))
  (route/resources "/")
  (route/not-found "Page not found"))

To debug this, I am using Charles, the network debugger: http://www.charlesproxy.com/

I have a Clojure app running locally. I have an HTML form, and I hit the submit button. Charles shows that I am posting to this URL:


And http verb is POST.

But I get a 404 error. 

The GET request to the same URL works perfectly. 

What did I do wrong? 




 

Nelson Morris

unread,
Mar 17, 2013, 3:51:58 PM3/17/13
to comp...@googlegroups.com
Does (admin-update ....) return nil?
> --
> You received this message because you are subscribed to the Google Groups
> "Compojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to compojure+...@googlegroups.com.
> To post to this group, send email to comp...@googlegroups.com.
> Visit this group at http://groups.google.com/group/compojure?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

larry google groups

unread,
Mar 17, 2013, 3:57:28 PM3/17/13
to comp...@googlegroups.com

Ah, nice catch! My bad. Wrong nesting of parenthesizes. 

larry google groups

unread,
Mar 17, 2013, 4:01:21 PM3/17/13
to comp...@googlegroups.com
Hmm, but still 404. 

larry google groups

unread,
Mar 17, 2013, 4:06:32 PM3/17/13
to comp...@googlegroups.com
Fixed. Thanks for pointing me in the right direction. 
Reply all
Reply to author
Forward
0 new messages