Comments (9)
Yes, after consideration I think yada should support returning a body in PUT/POST as per the lines of the spec. Let's keep this issue open.
from yada.
Hi guys!
Do we have some shortcut for having body in PUT until proper impl and release?
I'm trying this with no lucky
(defrecord MyRecordType [d])
(extend-protocol PutResult
MyRecordType
(interpret-put-result [o ctx]
(assoc-in ctx [:response :body] (:d o))))
from yada.
PUT bodies should work - see the phonebook example. Or do you mean
response bodies?
On 8 March 2016 at 10:35, tangrammer [email protected] wrote:
Hi guys!
Do we have some shortcut for having body in PUT until proper impl and
release?
I'm trying this with no lucky—
Reply to this email directly or view it on GitHub
#26 (comment).
from yada.
sorry, I meant response bodies :)
from yada.
Thanks Malcolm!
could i ask you to do a release including this commit?
BTW: I tried to find tag xxxx-32 to work on top of it but i couldn't find it
from yada.
Yes... but my tests fail :(
But give me a couple of hours...
On 8 Mar 2016 13:57, "tangrammer" [email protected] wrote:
Thanks Malcolm!
could i ask you to do a release including this commit?
BTW: I tried to find tag xxxx-32 to work on top of it but i couldn't find
it—
Reply to this email directly or view it on GitHub
#26 (comment).
from yada.
👍 👍
from yada.
Hi,
You can do this by returning a modified response, which yada's method proxy
interprets that you want to control what is returned.
(testing "return response"
(let [h (yada (resource {:methods {:put {:response (fn [ctx](assoc
%28:response ctx%29 :body))}}}))
response (h (request :put "/"))](is %28= "BODY" %28b/to-string %28:body @response))))))
I've had to back out the last commit because it broke some test, but I've
added the above test which passes.
Regards,
Malcolm
JUXT LTD.
Software Consulting, Delivery, Training
On 8 March 2016 at 14:59, tangrammer [email protected] wrote:
[image: 👍] [image: 👍]
—
Reply to this email directly or view it on GitHub
#26 (comment).
from yada.
Thanks for the solution :)
I had to change the status to 200 in order to have aleph (or the yada handler?) actually serving the body. (with status 204, the body is not send, although the header contains a correct content length). To reflect that, I prepared a PR with the corresponding change in the test.
Pull Request: #72
from yada.
Related Issues (20)
- Authentication schemes cannot be configured per request method HOT 3
- Request Body not present in ctx in case plumatic schema validation failure, defined in resource. HOT 2
- Yada manual edge example out of date HOT 3
- More reflection warnings HOT 1
- Incorrect multipart header processing
- Unable to access content-type in authorization
- Multipart throws "Malformed boundary" error when sent an empty submission
- is CI broken? HOT 1
- yada.swagger-parameters & yada.parameters are almost the same code. HOT 1
- :x-frame-options DENY is not a valid value
- Assumes clj-time will come in through ring-core (aka incompatible with ring-core 1.8.1)
- Plans for PATCH support
- Impossible to pretty-print response bodies by using `pretty=true` media type parameter
- Is it possible to determine if a path/href string is part of my system? HOT 1
- Yada may give out of memory exception (java.lang.OutOfMemoryError, OOM) when put under load
- Unsetting cookies: expires vs max-age
- `content-length` is incorrectly set to 0 when responding with HTTP 304 to GET requests
- Cannot use aleph 0.5.0 with yada HOT 6
- Test failure on master
- 404 for docs link
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yada.