<p>i met a problem by using requests.get() on kubernetes api</p>

<pre><code>url = 'http://10.69.117.136:8080/api/v1/namespaces/"default"/pods/tas-core/'
json = requests.get(url)
print json.content
</code></pre>

<p>error code 404 will be returned as:
{"kind": "Status","apiVersion": "v1","metadata": {},"status": "Failure","message": "pods \"tas-core\" not found","reason": "NotFound","details": {"name": "tas-core","kind": "pods"},"code": 404}</p>

<p>but if i use GET/curl, the response could be returned successfully:</p>

<pre><code>curl http://10.69.117.136:8080/api/v1/namespaces/"default"/pods/tas-core/
</code></pre>

<p>{"kind": "Pod","apiVersion": "v1","metadata": {"name": "tas-core","namespace":"default","selfLink": "/api/v1/namespaces/default/pods/tas-core","uid": "a264ce8e-a956-11e5-8293-0050569761f2","resourceVersion": "158546","creationTimestamp": "2015-12-23T09:22:06Z","labels": {"app": "tas-core"},"annotations": {"ctrl": "dynamic","oam": "dynamic"}},"spec": {"volumes":[ ...</p>

<p>further more shorter url works fine</p>

<pre><code>url = 'http://10.69.117.136:8080/api/v1/namespaces/'
json = requests.get(url)
print json.content
</code></pre>

<p>{"kind":"NamespaceList","apiVersion":"v1","metadata":{"selfLink":"/api/v1/namespaces/","resourceVersion":"220452"},"items":[{"metadata":{"name":"default","selfLink":"/api/v1/namespaces/default","uid":"74f89440-a94a-11e5-9afd-0050569761f2","resourceVersion":"6","creationTimestamp":"2015-12-23T07:54:55Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}}]}</p>

<p>where did i wrong?</p>

<p>Making the request from <code>requests</code> and from command line sends it to different urls.</p>

<p>The <code>requests</code> request from Python code really tries to use url including the quotes.</p>

<p><code>curl</code> from command line does strip the quotes (in other cases it escapes the quotes).</p>

<p>I am unable to test your real url for real requests, but I guess, that following might work:</p>

<pre><code>url = 'http://10.69.117.136:8080/api/v1/namespaces/default/pods/tas-core/'
json = requests.get(url)
print json.content
</code></pre>
