<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><span style="line-height:1.5">The ideal world you described is probably the 3rd-party Requests package:</span><br></div><div><br></div><div><div>>>> import requests</div><div><div><div>>>> resp = requests.get('<a href="http://erg.delph-in.net/rest/0.9/parse?input=%E3%81%82" target="_blank">http://erg.delph-in.net/rest/0.9/parse?input=あ</a> is a Japanese character.')</div><div>>>> resp.json()['input']</div><div>'あ is a Japanese character.'</div></div></div></div><div><br></div><div>(notice the あ is returned in the response; i.e. it was encoded in the request AND decoded in the response; furthermore, this works unmodified for both Python 2 and 3)</div><div><br></div><div>But I share your desire for a simple solution that has no dependencies outside of the standard libraries, so I'll see if I can make it work.</div></div></div></blockquote><div><br></div><div>I have but a minor contribution to this discussion: my understanding is that the Requests package has been effectively officially sanctioned as way to do HTTP in Python (as Mike alluded to), and the<span style="line-height:1.5"> reason it has not been rolled into the standard library is to </span>facilitate<span style="line-height:1.5"> faster security updates through PyPI than would occur with the official Python distribution. </span></div><div><br></div><div>So if there was going to be an exception to the maxim of having minimal dependencies, this would be a good candidate. </div><div><br></div><div>Also, I'm looking forward to trying out the API soon, thanks very much for all the work Stephan!</div><div><br></div><div>Ned</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
—once you have had a chance to look at RESTful client implementation<br>
yourself, i will be curious to see which solution you adopt!<br></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>Python has a nice ImportError that you can catch, and since Python2 doesn't have the urllib.request or urllib.parse sub-packages, I exploit this to write custom pre-encoding code for Python2. It sounds a little hacky, but it's a pretty common pattern for code meant to work with both versions. But given that Python3's quote function takes either bytes or unicode strings, I might not need to do this. More soon.</div><div><br></div><div>Btw, in the current version of the MRS-JSON format, I noticed that handles had no "type", where I expected {"type": "h"}.</div><div><br></div><div>Thanks</div></div></div>
</blockquote></div></div>