<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Micropython post error]]></title><description><![CDATA[<p dir="auto">Hello everybody, I have a problem, I'm trying to send a wav file using the "urequests" library, but I can't do it. I use a M5GO (FIRE) and micro-piton returns the following error:</p>
<p dir="auto">TypeError: object with buffer protocol required</p>
<p dir="auto">Any one knows how I can solve this?.</p>
<p dir="auto">This is my code:</p>
<pre><code>    url = "http://server_addres/wav_file"
    fin = wave.open('/sd/temp.wav', 'rb')
    
    file_to_send= {'file': ubinascii.b2a_base64(fin)}
    header={"content-type":"audio/wav", 'file': ubinascii.b2a_base64(fin)}
    
    # data=file_to_send,
    
    try:
        r = urequests.post(url,  headers=header)
        print (r.text)
    finally:
        print("Close...")
        fin.close()
</code></pre>
<p dir="auto">Regards</p>
<p dir="auto">Jarain78</p>
]]></description><link>https://community.m5stack.com/topic/318/micropython-post-error</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 19:30:07 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/318.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Sep 2018 10:43:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Micropython post error on Sun, 25 Aug 2024 19:44:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jarain78" aria-label="Profile: jarain78">@<bdi>jarain78</bdi></a> Hello,</p>
<p dir="auto">I'm currently facing the same pb with my M5dial:</p>
<p dir="auto">Any idea ?</p>
<pre><code>URL_REFRESH='https://api.netatmo.com/oauth2/token'

    params={
        'grant_type':'refresh_token',
        "client_id":'xxx',
        "client_secret":'xxx',
        "refresh_token":'xxx'
    }

rep=requests.post(URL_REFRESH, data=params)
</code></pre>
<p dir="auto">=&gt; TypeError: object with buffer protocol required</p>
]]></description><link>https://community.m5stack.com/post/26224</link><guid isPermaLink="true">https://community.m5stack.com/post/26224</guid><dc:creator><![CDATA[Microbug]]></dc:creator><pubDate>Sun, 25 Aug 2024 19:44:01 GMT</pubDate></item></channel></rss>