I see. Should be "encoding". Thanks.
/H.
On 2020-11-03 19:30, Dieter Maurer wrote:
Hernán De Angelis wrote at 2020-11-2 10:06 +0100:
...
My request has the form:
header = {'Content-type':'application/xml', 'charset':'utf-8'}
Not your problem (which you have already resolved) but:
`charset` i
Hernán De Angelis wrote at 2020-11-2 10:06 +0100:
> ...
>My request has the form:
>
>header = {'Content-type':'application/xml', 'charset':'utf-8'}
Not your problem (which you have already resolved) but:
`charset` is not an individual header but a parameter
for the `Content-Type` header. For `xml`
On 2020-11-02, Ethan Furman wrote:
> On 11/2/20 9:32 AM, Karsten Hilbert wrote:
>
>> because .encode() does not operate in-place.
>
> Yeah, none of the string operations do, and it's embarrassing how
> many times that still bites me. :-/
I've been writing Python for a little over 20 years. In an
Thanks, I now learned the lesson. 👍
Den mån 2 nov. 2020 18:58Ethan Furman skrev:
> On 11/2/20 9:32 AM, Karsten Hilbert wrote:
>
> > because .encode() does not operate in-place.
>
> Yeah, none of the string operations do, and it's embarrassing how many
> times that still bites me. :-/
>
> --
> ~
No worries ☺
Den mån 2 nov. 2020 19:05Karsten Hilbert skrev:
> On Mon, Nov 02, 2020 at 06:43:20PM +0100, Hernán De Angelis wrote:
>
> > I see, my mistake was (tacitly) assuming that encode() could work in
> place.
> >
> > Now I see that it should work in a previous line as you wrote.
> >
> > Tha
On Mon, Nov 02, 2020 at 06:43:20PM +0100, Hernán De Angelis wrote:
> I see, my mistake was (tacitly) assuming that encode() could work in place.
>
> Now I see that it should work in a previous line as you wrote.
>
> Thank you!
Sure, and excuse my perhaps slightly terse tone in that earlier mail .
On 11/2/20 9:32 AM, Karsten Hilbert wrote:
because .encode() does not operate in-place.
Yeah, none of the string operations do, and it's embarrassing how many times
that still bites me. :-/
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
I see, my mistake was (tacitly) assuming that encode() could work in place.
Now I see that it should work in a previous line as you wrote.
Thank you!
/H.
On 2020-11-02 18:32, Karsten Hilbert wrote:
On Mon, Nov 02, 2020 at 06:21:15PM +0100, Hernán De Angelis wrote:
For the record:
Just repl
On Mon, Nov 02, 2020 at 06:21:15PM +0100, Hernán De Angelis wrote:
For the record:
> Just reply to myself and whoever might find this useful.
>
> encode() must be done within the request call:
Nope (but it can, as you showed).
> header = {'Content-type':'application/xml', 'charset':'UTF-8'}
> r
On Tue, Nov 3, 2020 at 4:22 AM Hernán De Angelis
wrote:
>
> Just reply to myself and whoever might find this useful.
>
> encode() must be done within the request call:
>
> header = {'Content-type':'application/xml', 'charset':'UTF-8'}
> response = requests.post(server, data=request.encode('utf-8')
Just reply to myself and whoever might find this useful.
encode() must be done within the request call:
header = {'Content-type':'application/xml', 'charset':'UTF-8'}
response = requests.post(server, data=request.encode('utf-8'),
headers=header)
not in a previous separate line as I did.
Now
Hi everyone,
I am writing a program that sends a post request to a server. The post
request may include keywords with Swedish characters (åöä).
I noticed that requests that include strings without those characters
return a useful expected response. On the other hand, posts including
those ch
12 matches
Mail list logo