<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Greg Schoeninger on Medium]]></title>
        <description><![CDATA[Stories by Greg Schoeninger on Medium]]></description>
        <link>https://medium.com/@gregschoeninger?source=rss-96304698a74------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*i-yidGu8xYbYlcC9RneStQ.jpeg</url>
            <title>Stories by Greg Schoeninger on Medium</title>
            <link>https://medium.com/@gregschoeninger?source=rss-96304698a74------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 01:35:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gregschoeninger/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HTTP upload progress bar with Rust]]></title>
            <link>https://medium.com/@gregschoeninger/http-upload-progress-bar-with-rust-5301955f5d1d?source=rss-96304698a74------2</link>
            <guid isPermaLink="false">https://medium.com/p/5301955f5d1d</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Greg Schoeninger]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 18:50:38 GMT</pubDate>
            <atom:updated>2022-07-20T18:51:14.220Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple example of creating an upload progress bar for an HTTP request using Rust.</p><p>We are assuming you are using the <a href="https://docs.rs/reqwest/0.11.11/reqwest/index.html">reqwest</a> library <strong>v0.11.11</strong> for HTTP requests and <a href="https://docs.rs/indicatif/0.16.2/indicatif/index.html">indicatif</a> <strong>v0.16.2</strong> for the progress bar. For the full source code, go <a href="https://github.com/gschoeni/RustHTTPUploadProgress">here</a>.</p><p>In this example we are using the `reqwest::blocking` interface as to not deal with any async/await complexity.</p><p>First you must create a struct that implements the <strong>std::io::Read</strong> trait. This trait is used under the hood when reading the buffer you want to upload to the server by the reqwest library.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd03ff95426e2bb82ed0487094115ef8/href">https://medium.com/media/cd03ff95426e2bb82ed0487094115ef8/href</a></iframe><p>Next, for the actual uploading. Read the file into a <strong>Vec&lt;u8&gt;</strong> buffer, and wrap this buffer in a <strong>std::io::Cursor</strong>.</p><p>You could also use the file handle itself, or any object that implements the <strong>Read</strong> trait, I found it useful to see how it is done with a raw data buffer and cursor as well.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6dbbccf533a4e89198b8b32e64cf134f/href">https://medium.com/media/6dbbccf533a4e89198b8b32e64cf134f/href</a></iframe><p>The full example with an actix-web server to upload to can be found on <a href="https://github.com/gschoeni/RustHTTPUploadProgress">github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5301955f5d1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>