Commit a2babb2
committed
Fix pagination URL encoding.
APIs supporting pagination use a square bracket parameter to index the page and
the offset. The format is not correctly encoded by the urlencode method from
urllib when building the URL parameter list, since multidimensional dictionaries
are not supported.
For following example:
{'longitude': 0.1278, 'latitude': 51.5074, 'page': {'offset': 10}}
is encoded as:
longitude=0.1278&latitude=51.5074&page={offset : 10}
instead of:
longitude=0.1278&latitude=51.5074&page[offset]=10
The new private method _urlencode parses and prepares the dictionary before the
actual call to urlencode is done.
Resolves: #281 parent 29a49b4 commit a2babb2
1 file changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
0 commit comments