Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100541

Re: error reading api with urllib

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: error reading api with urllib
Date Wed, 16 Dec 2015 16:24:54 -0700
Lines 18
Message-ID <mailman.26.1450308337.30845.python-list@python.org> (permalink)
References <9aa21642-765b-4666-8c66-a6dab9928c37@googlegroups.com> <n4snji$mi4$1@reader1.panix.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de 7BjAniKKZ777W/+7rf/Wog2uJohDNAZi4nHPlFf0uLtg==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; '16,': 0.03; 'defaults': 0.05; "b''": 0.09; 'called.': 0.09; 'specifying': 0.09; 'stored': 0.10; 'subject:error': 0.11; 'wed,': 0.15; 'inclined': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:api': 0.16; 'subject:urllib': 0.16; 'wrote:': 0.16; '2015': 0.20; "aren't": 0.22; 'object.': 0.22; 'dec': 0.23; 'recognized': 0.24; 'header :In-Reply-To:1': 0.24; "doesn't": 0.26; 'message- id:@mail.gmail.com': 0.27; 'data,': 0.27; 'skip:u 20': 0.28; '(it': 0.29; 'that.': 0.30; 'probably': 0.31; 'etc.)': 0.32; 'problem': 0.33; 'received:google.com': 0.35; 'received:209.85': 0.36; '(i.e.': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'received:209.85.213': 0.37; 'doing': 0.38; 'received:209': 0.38; 'means': 0.39; 'to:addr:python.org': 0.40; 'subject:with': 0.40; 'your': 0.60; 'john': 0.61; 'email addr:gmail.com': 0.62; 'more': 0.63; 'post,': 0.84; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=NIudEnmiXmKQMLnhBHG9wo4QR7f7Lw12s5Pr8AseLdc=; b=QZ1zPmBM0iOoH6ep/jTHNpCQ4iN/yQasu9g7nudVN9hensbIaGNyD+UeRvT5M6fz4s tYZIbOfsn8kIfcHEIKNbhxLj2A4hJs+vst9PWot9unPNT89xc8aMMh39fEuLY451Qktg o65LlpALol6YnjuLdU6EdTI34+SQcextL51qwuUPkxAQk8aWck84/DBmSPmm71Q/FZjL ovjfAzIR0+gyJt+Cg94q61z2w8v4tq96vwtvhSn9vhav3T3D1uKI+lD58sD+Kcd4kSvv SmXlM3/LUtM0z4+mGilEDOQdasHV3JcKjpwKxo9y4gEgNoHFmqMuUkanbxwHIk6tvQbJ 3+cg==
X-Received by 10.50.154.5 with SMTP id vk5mr417094igb.85.1450308333987; Wed, 16 Dec 2015 15:25:33 -0800 (PST)
In-Reply-To <n4snji$mi4$1@reader1.panix.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:100541

Show key headers only | View raw


On Wed, Dec 16, 2015 at 3:12 PM, John Gordon <gordon@panix.com> wrote:
> In <9aa21642-765b-4666-8c66-a6dab9928c37@googlegroups.com> simian336@gmail.com writes:
>
>> Bad Request
>> b''
>
>
> That probably means you aren't using one of the recognized methods
> (i.e. GET, POST, etc.)
>
> It doesn't look like you are specifying one of these methods on your
> Request object.  Try doing that.
>
> (It works in your browser because it defaults to GET automatically.)

urllib.request.Request also defaults to GET unless the request
includes data, in which case it defaults to POST. I would be more
inclined to suspect a problem with the stored procedure being called.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

error reading api with urllib simian336@gmail.com - 2015-12-15 17:54 -0800
  Re: error reading api with urllib Simian <simian336@gmail.com> - 2015-12-15 18:46 -0800
    Re: error reading api with urllib Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-16 16:22 -0700
  Re: error reading api with urllib John Gordon <gordon@panix.com> - 2015-12-16 22:12 +0000
    Re: error reading api with urllib Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-16 16:24 -0700
  Re: error reading api with urllib Simian <simian336@gmail.com> - 2015-12-17 11:29 -0800

csiph-web