Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9247023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:37:50+00:00 2026-06-18T09:37:50+00:00

EDIT – The source code is on github if you’re interested. Thanks I am

  • 0

EDIT – The source code is on github if you’re interested. Thanks


I am a bit confused as to how to access json data that has been posted to a url in clojure; I just can’t seem to get it to work.

This is my route:

(cc/POST "/add" 
request
(str ": " request))

I am not entirely sure what I have to put in place of request – I just saw some blog online and tried to follow it, but couldn’t get it to work.

Here’s how I’m trying to post: (from fiddler)

fiddler posting data

note: request header port is different in the image; it’s a mistake, I was trying to mess with that data to see what it says so ignore that part in the above image please

In curl, I’m just doing this:

curl -X POST -H "Content-Type: application/json" -d '{"foo":"bar","baz":5}' 
     http://localhost:3005/add

It looks like clojure is not receiving the json data that I posted at all.

Here’s what the request var contains:

: {:scheme :http, :query-params {}, :form-params {}, :request-method :post, 
   :query-string nil, :route-params {}, :content-type "\"application/json\"", 
   :uri "/event", :server-name "localhost", :params {}, 
   :headers {"user-agent" "Fiddler", "content-type" "\"application/json\"", 
          "content-length" "23", "host" "localhost:3005"}, 
   :content-length 23, :server-port 3005, :character-encoding nil, :body #}

As you can see, all params are empty…

I am using compojure and cheshire – and I can convert data into json and return them just fine for GET routes.. I need to figure out how to pass json and convert it into clojure data..

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:37:51+00:00Added an answer on June 18, 2026 at 9:37 am

    That’s because :params is filled by a ring middleware which deals with “form-encoded” body.

    You can use ring-json to wrap your application into this other middleware. It will parse the JSON body and fill :params accordingly. (https://github.com/ring-clojure/ring-json)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: full source code now available at https://bitbucket.org/moerie/multilanguagestring I've implemented a class called MultilingualString
EDIT: Ive edited my code a little thanks to Alexander's advice, but im still
EDIT I tested release in 32 bit, and the code was compact. Therefore the
Edit: For personn interested in a cleaner way to implemenent that, have a look
EDIT: After spending a bit of time understanding the code I wrote I still
Edit: This question has been moved to Getting an error from Xcode that is
EDIT: I forgot to mention, I do not have source code for the DLL
EDIT: I was an idiot. I simply had an image that was vertically long,
EDIT: See my answer below--> I am wanting to have a view that when
EDIT: iam using ajax to load text in my content that is why onload

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.