##// END OF EJS Templates
phabricator: properly encode boolean types in the request body...
Matt Harbison -
r41073:d7d3164e stable
parent child Browse files
Show More
@@ -0,0 +1,73 b''
1 {
2 "interactions": [
3 {
4 "response": {
5 "status": {
6 "message": "OK",
7 "code": 200
8 },
9 "headers": {
10 "content-type": [
11 "application/json"
12 ],
13 "date": [
14 "Fri, 21 Dec 2018 22:19:11 GMT"
15 ],
16 "x-content-type-options": [
17 "nosniff"
18 ],
19 "cache-control": [
20 "no-store"
21 ],
22 "strict-transport-security": [
23 "max-age=0; includeSubdomains; preload"
24 ],
25 "x-frame-options": [
26 "Deny"
27 ],
28 "set-cookie": [
29 "phsid=A%2Fdv22bpksbdis3vfeksluagfslhfojblbnkro7we4; expires=Wed, 20-Dec-2023 22:19:11 GMT; Max-Age=157680000; path=/; domain=phab.mercurial-scm.org; secure; httponly"
30 ],
31 "x-xss-protection": [
32 "1; mode=block"
33 ],
34 "expires": [
35 "Sat, 01 Jan 2000 00:00:00 GMT"
36 ],
37 "transfer-encoding": [
38 "chunked"
39 ],
40 "server": [
41 "Apache/2.4.10 (Debian)"
42 ]
43 },
44 "body": {
45 "string": "{\"result\":{\"data\":[],\"maps\":{},\"query\":{\"queryKey\":null},\"cursor\":{\"limit\":100,\"after\":null,\"before\":null,\"order\":null}},\"error_code\":null,\"error_info\":null}"
46 }
47 },
48 "request": {
49 "method": "POST",
50 "headers": {
51 "accept": [
52 "application/mercurial-0.1"
53 ],
54 "content-type": [
55 "application/x-www-form-urlencoded"
56 ],
57 "content-length": [
58 "70"
59 ],
60 "host": [
61 "phab.mercurial-scm.org"
62 ],
63 "user-agent": [
64 "mercurial/proto-1.0 (Mercurial 4.8.1+564-6f483b107eb5+20181221)"
65 ]
66 },
67 "uri": "https://phab.mercurial-scm.org//api/user.search",
68 "body": "constraints%5BisBot%5D=true&api.token=cli-hahayouwish"
69 }
70 }
71 ],
72 "version": 1
73 } No newline at end of file
@@ -155,6 +155,8 b' def urlencodenested(params):'
155 """
155 """
156 flatparams = util.sortdict()
156 flatparams = util.sortdict()
157 def process(prefix, obj):
157 def process(prefix, obj):
158 if isinstance(obj, bool):
159 obj = {True: b'true', False: b'false'}[obj] # Python -> PHP form
158 items = {list: enumerate, dict: lambda x: x.items()}.get(type(obj))
160 items = {list: enumerate, dict: lambda x: x.items()}.get(type(obj))
159 if items is None:
161 if items is None:
160 flatparams[prefix] = obj
162 flatparams[prefix] = obj
@@ -65,6 +65,27 b' Create a differential diff:'
65 D4597 - created - 1a5640df7bbf: create beta for phabricator test
65 D4597 - created - 1a5640df7bbf: create beta for phabricator test
66 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/1a5640df7bbf-6daf3e6e-phabsend.hg
66 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/1a5640df7bbf-6daf3e6e-phabsend.hg
67
67
68 $ hg debugcallconduit user.search --test-vcr "$VCR/phab-conduit.json" <<EOF
69 > {
70 > "constraints": {
71 > "isBot": true
72 > }
73 > }
74 > EOF
75 {
76 "cursor": {
77 "after": null,
78 "before": null,
79 "limit": 100,
80 "order": null
81 },
82 "data": [],
83 "maps": {},
84 "query": {
85 "queryKey": null
86 }
87 }
88
68 Template keywords
89 Template keywords
69 $ hg log -T'{rev} {phabreview|json}\n'
90 $ hg log -T'{rev} {phabreview|json}\n'
70 1 {"id": "D4597", "url": "https://phab.mercurial-scm.org/D4597"}
91 1 {"id": "D4597", "url": "https://phab.mercurial-scm.org/D4597"}
General Comments 0
You need to be logged in to leave comments. Login now