-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
leplatrem
commented
Feb 5, 2015
- update docs
- validation schema of batch
- invoke subrequests http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/subrequest.html
- catch errors
- serialize responses
- merge headers specified with current request
- defaults values for requests
- limit number of operations (from settings ?)
@Natim @tarekziade @ametaireau This is a first shot on the implementation of |
"body" : { | ||
"title": "MoFo", | ||
"url" : "http://mozilla.org" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: update this to put body as string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a requirements? It seems strange to me to have JSON encoded string inside a JSON. I rather prefer to have a nested object instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right. But we should support both then (suppose we want to support xml or form encoded payloads)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we don't :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I concur here: we currently don't and in case we want to, we can re-assess this formalism to include arbitrary strings.
|
||
:note: | ||
|
||
The responses are not necessarily in the same order of the requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it should. I doesn't make sense to have them in another order since they don't have ids how to you merge the results if there are not in the same order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to leave this, in case batch requests are executed asynchronously. I can add a counter then :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asynchronously doesn't means that the results should be shuffled. See https://github.com/caolan/async#maparr-iterator-callback
a350e58
to
6c11de7
Compare
@Natim r? |
|
||
:: | ||
|
||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we provide examples, we should do it with HTTPie so that it's easier for clients to reproduce.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be adressed in #101
for k, v in defaults.items(): | ||
if k == 'headers': | ||
for i, j in v.items(): | ||
request.get(k, {}).setdefault(i, j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored in #98 :)