<?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 Dropbox API problem in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362407#M20605</link>
    <description>&lt;P&gt;I am developing an ap using Flutter framework. My app involves me using dropbox api to upload folders from my phone to my dropbox account. The problem I am having now is an error with content-type in the API. What content-type can I use for dropbox in my flutter app?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2019 08:17:29 GMT</pubDate>
    <dc:creator>devolajide</dc:creator>
    <dc:date>2019-08-29T08:17:29Z</dc:date>
    <item>
      <title>Dropbox API problem</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362407#M20605</link>
      <description>&lt;P&gt;I am developing an ap using Flutter framework. My app involves me using dropbox api to upload folders from my phone to my dropbox account. The problem I am having now is an error with content-type in the API. What content-type can I use for dropbox in my flutter app?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 08:17:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362407#M20605</guid>
      <dc:creator>devolajide</dc:creator>
      <dc:date>2019-08-29T08:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API problem</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362461#M20606</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/57692602/flutter-http-content-type" target="_blank"&gt;https://stackoverflow.com/questions/57692602/flutter-http-content-type&lt;/A&gt;&amp;nbsp;]&lt;/P&gt;
&lt;P&gt;For reference, can you share the relevant code, and the error you're getting?&lt;/P&gt;
&lt;P&gt;When uploading to&amp;nbsp;Dropbox via the API, e.g., using the&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_self"&gt;/2/files/upload&lt;/A&gt;, the&amp;nbsp;Dropbox API expects the file data in the request body, with a "Content-Type" of "application/octet-stream".&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 14:00:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362461#M20606</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-08-29T14:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API problem</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362536#M20611</link>
      <description>&lt;P&gt;Here's the code&lt;/P&gt;&lt;PRE&gt; String token = API().token;
      var map = new Map&amp;lt;String, String&amp;gt;();
      map["Dropbox-API-Arg"] = '{"path": "/EasyBay/Project1/image.txt"}';

      Map&amp;lt;String, String&amp;gt; requestHeaders = {
        'Content-type': 'application/octet-stream', 
        'User-Agent': 'api-explorer-client',
       // 'Dropbox-API-Arg': '{"path": "/EasyBay/Project1/image.txt"}',
        'Authorization': 'Bearer' + token
      };

      var response = await http.post(new API().upload_link, body: map, headers: requestHeaders);
      print(response.statusCode);
      return parseChat(response.body);&lt;/PRE&gt;&lt;P&gt;While this is the error&lt;/P&gt;&lt;LI-SPOILER&gt;E/flutter ( 4498): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Bad state: Cannot set the body fields of a Request with content-type "application/octet-stream".&lt;BR /&gt;E/flutter ( 4498): #0 Request.bodyFields= (package:http/src/request.dart:124:7)&lt;BR /&gt;E/flutter ( 4498): #1 BaseClient._sendUnstreamed (package:http/src/base_client.dart:163:17)&lt;BR /&gt;E/flutter ( 4498): &amp;lt;asynchronous suspension&amp;gt;&lt;BR /&gt;E/flutter ( 4498): #2 BaseClient.post (package:http/src/base_client.dart:54:7)&lt;BR /&gt;E/flutter ( 4498): #3 post.&amp;lt;anonymous closure&amp;gt; (package:http/http.dart:70:16)&lt;BR /&gt;E/flutter ( 4498): #4 _withClient (package:http/http.dart:166:20)&lt;BR /&gt;E/flutter ( 4498): &amp;lt;asynchronous suspension&amp;gt;&lt;BR /&gt;E/flutter ( 4498): #5 post (package:http/http.dart:69:5)&lt;BR /&gt;E/flutter ( 4498): #6 uploadFolder (package:eastbay/src/Api/uploadApi.dart:25:28)&lt;BR /&gt;E/flutter ( 4498): &amp;lt;asynchronous suspension&amp;gt;&lt;BR /&gt;E/flutter ( 4498): #7 _UploadFolderState.Upload (package:eastbay/src/ui/upload.dart:43:19)&lt;BR /&gt;E/flutter ( 4498): #8 _UploadFolderState.build.&amp;lt;anonymous closure&amp;gt; (package:eastbay/src/ui/upload.dart:28:15)&lt;BR /&gt;E/flutter ( 4498): #9 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:654:14)&lt;BR /&gt;E/flutter ( 4498): #10 _InkResponseState.build.&amp;lt;anonymous closure&amp;gt; (package:flutter/src/material/ink_well.dart:729:32)&lt;BR /&gt;E/flutter ( 4498): #11 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)&lt;BR /&gt;E/flutter ( 4498): #12 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11)&lt;BR /&gt;E/flutter ( 4498): #13 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275:7)&lt;BR /&gt;E/flutter ( 4498): #14 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455:9)&lt;BR /&gt;E/flutter ( 4498): #15 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75:13)&lt;BR /&gt;E/flutter ( 4498): #16 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102:11)&lt;BR /&gt;E/flutter ( 4498): #17 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)&lt;BR /&gt;E/flutter ( 4498): #18 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)&lt;BR /&gt;E/flutter ( 4498): #19 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)&lt;BR /&gt;E/flutter ( 4498): #20 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)&lt;BR /&gt;E/flutter ( 4498): #21 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)&lt;BR /&gt;E/flutter ( 4498): #22 _rootRunUnary (dart:async/zone.dart:1136:13)&lt;BR /&gt;E/flutter ( 4498): #23 _CustomZone.runUnary (dart:async/zone.dart:1029:19)&lt;BR /&gt;E/flutter ( 4498): #24 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)&lt;BR /&gt;E/flutter ( 4498): #25 _invoke1 (dart:ui/hooks.dart:263:10)&lt;BR /&gt;E/flutter ( 4498): #26 _dispatchPointerDataPacket (dart:ui/hooks.dart:172:5)&lt;BR /&gt;E/flutter ( 4498): &lt;/LI-SPOILER&gt;</description>
      <pubDate>Thu, 29 Aug 2019 22:05:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362536#M20611</guid>
      <dc:creator>h21</dc:creator>
      <dc:date>2019-08-29T22:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API problem</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362624#M20617</link>
      <description>&lt;P&gt;Thanks! It looks like the error message is:&lt;/P&gt;
&lt;P&gt;"Bad state: Cannot set the body fields of a Request with content-type "application/octet-stream"."&lt;/P&gt;
&lt;P&gt;That's not an error message from the&amp;nbsp;Dropbox API itself. It appears to be an error message from the HTTP client you're using. It looks like the problem is that you're attempting to set the "body" parameter to be a Map value, which isn't supported in this case.&lt;/P&gt;
&lt;P&gt;When uploading to&amp;nbsp;Dropbox via an upload API endpoint, the request body should contain the file data. In your code you're attempting to set it to a Map contain the API parameters, which wouldn't work anyway.&lt;/P&gt;
&lt;P&gt;You should update your code to send the file data in the request body, and set the API parameters for the API call in a "Dropbox-API-Arg" request header, which would be in the "requestHeaders" variable you currently have (like the commented out line).&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 15:39:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362624#M20617</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-08-30T15:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API problem</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362771#M20621</link>
      <description>&lt;P&gt;Thanks. I will check it out&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2019 13:11:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-problem/m-p/362771#M20621</guid>
      <dc:creator>h21</dc:creator>
      <dc:date>2019-08-31T13:11:44Z</dc:date>
    </item>
  </channel>
</rss>

