<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Content-Type setting for downloading using dropbox api v2 in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/310710#M18529</link>
    <description>Hi Robert, the reason I'm trying to add in the HTTP header is due to the "Bad HTTP content-type" message I am receiving... hence I thought I needed to specify one...&lt;BR /&gt;&lt;BR /&gt;Any ideas or even a sample code extract I could try of one that works&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Thu, 15 Nov 2018 02:13:05 GMT</pubDate>
    <dc:creator>Anoop_Brijmohun</dc:creator>
    <dc:date>2018-11-15T02:13:05Z</dc:date>
    <item>
      <title>Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/310212#M18525</link>
      <description>&lt;P&gt;Good-day,&amp;nbsp;&lt;/P&gt;&lt;P&gt;im busy trying to write a simple app to download files from dropbox.&lt;/P&gt;&lt;P&gt;im a newbie to mobile dev and asistance would be appricated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im am receiving this error when downloading.&lt;/P&gt;&lt;P&gt;Dropbox.Api.BadInputException: Error in call to API function "files/download": Bad HTTP "Content-Type" header: "application/x-www-form-urlencoded".&lt;BR /&gt;&amp;nbsp;Expecting one of "text/plain", "text/plain; charset=utf-8", "application/octet-stream", "application/octet-stream; charset=utf-8".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; var aHttpClient = new HttpClient();
                aHttpClient.DefaultRequestHeaders.Add("Content-Type", "application/octet-stream; charset=utf-8");
                var aDorpboxConfig = new DropboxClientConfig("ApplicationName") { HttpClient = aHttpClient };

                
                using (var dbx = new DropboxClient("Key_Here", aDorpboxConfig))
                {
                    
                    Dropbox.Api.Files.DownloadArg dargs = new Dropbox.Api.Files.DownloadArg(content.Path + "/" + content.Name) ;

                                  

                    using (var response = await dbx.Files.DownloadAsync(dargs))
                    {
                        var file = await response.GetContentAsStringAsync();
                       
                    }
                }&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:09:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/310212#M18525</guid>
      <dc:creator>Anoop_Brijmohun</dc:creator>
      <dc:date>2019-05-29T09:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/310343#M18527</link>
      <description>&lt;P&gt;There does not appear to be a need for a custom&amp;nbsp;HTTP&amp;nbsp;client in the sample code you have provided.&amp;nbsp; Is the custom&amp;nbsp;HTTP&amp;nbsp;client necessary, or can your code function without one?&lt;/P&gt;
&lt;P&gt;The .NET SDK does not require a custom HTTP client in order to function, nor do you need to explicitly set the&amp;nbsp;Content-Type&amp;nbsp;header.&amp;nbsp; Our .NET SDK will automatically create&amp;nbsp;an&amp;nbsp;HTTP client and set the appropriate headers for each API.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 18:45:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/310343#M18527</guid>
      <dc:creator>DBX_Robert</dc:creator>
      <dc:date>2018-11-14T18:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/310710#M18529</link>
      <description>Hi Robert, the reason I'm trying to add in the HTTP header is due to the "Bad HTTP content-type" message I am receiving... hence I thought I needed to specify one...&lt;BR /&gt;&lt;BR /&gt;Any ideas or even a sample code extract I could try of one that works&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 15 Nov 2018 02:13:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/310710#M18529</guid>
      <dc:creator>Anoop_Brijmohun</dc:creator>
      <dc:date>2018-11-15T02:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311136#M18534</link>
      <description>&lt;P&gt;I am able to run the following C# sample from our &lt;A href="https://www.dropbox.com/developers/documentation/dotnet#tutorial" target="_blank"&gt;.NET tutorials page&lt;/A&gt;.&amp;nbsp; It assumes a file named "file.txt" in the root folder of your Dropbox account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using System;
using System.Threading.Tasks;
using Dropbox.Api;

namespace sampleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var task = Task.Run((Func&amp;lt;Task&amp;gt;)Program.Run);
            task.Wait();
        }

        static async Task Run()
        {
            using (var dbx = new DropboxClient("&amp;lt;OAuth Token&amp;gt;"))
            {
                using (var response = await dbx.Files.DownloadAsync("/file.txt"))
                {
                    Console.WriteLine(await response.GetContentAsStringAsync());
                }
            }
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are doing this on mobile, are you using a framework like Xamarin?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 05:19:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311136#M18534</guid>
      <dc:creator>DBX_Robert</dc:creator>
      <dc:date>2018-11-16T05:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311193#M18536</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am using Xamarin Forms.&lt;/P&gt;&lt;P&gt;I receive this error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Error in call to API function "files/download": Bad HTTP "Content-Type" header: "application/x-www-form-urlencoded".&lt;BR /&gt;Expecting one of "text/plain", "text/plain; charset=utf-8", "application/octet-stream",&lt;BR /&gt;"application/octet-stream; charset=utf-8".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at this stage&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; using (var response = await dbx.Files.DownloadAsync("/Test.PDF"))&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Nov 2018 12:44:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311193#M18536</guid>
      <dc:creator>Anoop_Brijmohun</dc:creator>
      <dc:date>2018-11-16T12:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311537#M18540</link>
      <description>&lt;P&gt;That is the line of&amp;nbsp;code&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I would expect to be throwing the error based on the information you've shared.&lt;/P&gt;
&lt;P&gt;Your issue appears to be&amp;nbsp;very similar&amp;nbsp;to&amp;nbsp;&lt;A href="https://www.dropboxforum.com/t5/API-Support-Feedback/Xamarin-DropBox-APi-HTTP-400-Bad-request-on-DownloadAsync/m-p/302892" target="_blank"&gt;https://www.dropboxforum.com/t5/API-Support-Feedback/Xamarin-DropBox-APi-HTTP-400-Bad-request-on-DownloadAsync/m-p/302892&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Given that the code sample works in a standard .NET project, but does not in a Xamarin project, Xamarin is likely adding additional logic that is modifying the Content-Type header in this use case.&amp;nbsp; There is little we can do&amp;nbsp;to help in this situation as we do not provide support for Xamarin issues with the official Dropbox .NET SDK.&amp;nbsp; One place to possibly&amp;nbsp;find additional help&amp;nbsp;could be the &lt;A href="https://forums.xamarin.com/" target="_blank"&gt;Xamarin forums&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 03:39:21 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311537#M18540</guid>
      <dc:creator>DBX_Robert</dc:creator>
      <dc:date>2018-11-18T03:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311617#M18543</link>
      <description>&lt;P&gt;thanks for the support&amp;nbsp;&lt;/P&gt;&lt;P&gt;will follow up with Xamarin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 15:17:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311617#M18543</guid>
      <dc:creator>Anoop_Brijmohun</dc:creator>
      <dc:date>2018-11-18T15:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311852#M18551</link>
      <description>&lt;P&gt;Found the solution here&lt;/P&gt;&lt;P&gt;&lt;A title="Bad HTTP Request - Xamarin Dropbox API" href="https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/http-stack?tabs=windows" target="_blank"&gt;https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/http-stack?tabs=windows&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:11:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/311852#M18551</guid>
      <dc:creator>Anoop_Brijmohun</dc:creator>
      <dc:date>2018-11-19T14:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Content-Type setting for downloading using dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/315855#M18743</link>
      <description>&lt;P&gt;Please post any issues with the Xamarin binding here:&amp;nbsp;&lt;A href="https://github.com/xamarin/xamarincomponents" target="_blank"&gt;https://github.com/xamarin/xamarincomponents&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 15:13:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Content-Type-setting-for-downloading-using-dropbox-api-v2/m-p/315855#M18743</guid>
      <dc:creator>redth</dc:creator>
      <dc:date>2018-12-05T15:13:14Z</dc:date>
    </item>
  </channel>
</rss>

