babashka / babashka.curl

A This library is mostly replaced by https://github.com/babashka/http-client
Eclipse Public License 1.0
121 stars 9 forks source link

Add documentation for data-raw #24

Closed Heliosmaster closed 4 years ago

Heliosmaster commented 4 years ago

I've needed to use the following syntax

(curl/put address
          {:data-raw {"foo" ["bar" "baz"]}
           :throw false
           :debug true
           :raw-args ["-k"]})

So it'd be good to add some examples to the README as well

borkdude commented 4 years ago

@Heliosmaster Can you explain me what this examples does and why you need :data-raw? I don't think this is part of the public API yet.

Heliosmaster commented 4 years ago

Workaround to not have to stringify the json payload and pass it to :body :-p. I understand that it might not be part of the public api but it just felt cleaner to pass the map as data.

borkdude commented 4 years ago

I'm not sure if I understand your use case without more details, but so far it doesn't sound very compelling?

borkdude commented 4 years ago

If you are already using :raw-args why don't you just pass the data you want using a raw arg?

Heliosmaster commented 4 years ago

Not disagreeing with anything you just said. This issue was mainly with the fact that i didn't think that data-raw wasn't public on purpose, but it just lacked documentation.