<?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 No error message with line feed in json header in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/224927#M12166</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During using API I found weird behaviour of dropbox: when sending the new upload request (v2), if there is a 0xA (line feed) character in the end of &lt;SPAN&gt;Dropbox-API-Arg header, server will send correct metadata as response, but the file content from request will not be processed. The size field in metadata will be always 0 and the empty file will be created.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I wonder if I could receive some error message from server instead, like "Can not parse JSON" that I have in other cases.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:21:49 GMT</pubDate>
    <dc:creator>Grivus</dc:creator>
    <dc:date>2019-05-29T09:21:49Z</dc:date>
    <item>
      <title>No error message with line feed in json header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/224927#M12166</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During using API I found weird behaviour of dropbox: when sending the new upload request (v2), if there is a 0xA (line feed) character in the end of &lt;SPAN&gt;Dropbox-API-Arg header, server will send correct metadata as response, but the file content from request will not be processed. The size field in metadata will be always 0 and the empty file will be created.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I wonder if I could receive some error message from server instead, like "Can not parse JSON" that I have in other cases.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:21:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/224927#M12166</guid>
      <dc:creator>Grivus</dc:creator>
      <dc:date>2019-05-29T09:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: No error message with line feed in json header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/225043#M12185</link>
      <description>Can you share the code to reproduce this? Thanks in advance!</description>
      <pubDate>Fri, 09 Jun 2017 17:49:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/225043#M12185</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-06-09T17:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: No error message with line feed in json header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/225198#M12204</link>
      <description>&lt;P&gt;Some sample code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;string test = "{\"mode\":\"overwrite\",\"path\":\"/testFile.txt\"}";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Adding the line feed to end of the api-args&lt;/P&gt;&lt;P&gt;// Of cource, I am not adding this intentionally, that character will be in the end of the string from some Json parsing class&lt;BR /&gt;test += 0xA;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// set this to api-args&lt;/P&gt;&lt;P&gt;string dropboxApiHeader =&amp;nbsp;"Dropbox-API-Arg: ";&lt;/P&gt;&lt;P&gt;request.SetHeader(&lt;SPAN&gt;dropboxApiHeader + test);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// correctly fill all other headers&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// fill data-binary content&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;request.SetData("Test text!");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// sending request&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;request.Send();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And here is what I will get in response:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"name": "testFile.txt", "path_lower": "/testFile.txt", "path_display": "/testFile.txt","id": Some Id, "client_modified": Some time, "server_modified": Some time, "rev": Some Rev,"size": 0, "content_hash": Some hash}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I cut out the 0xA from the end of the dropbox-args, then data will be written correctly and size will be not 0.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2017 23:59:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/225198#M12204</guid>
      <dc:creator>Grivus</dc:creator>
      <dc:date>2017-06-10T23:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: No error message with line feed in json header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/225443#M12234</link>
      <description>Thanks! That's helpful.&lt;BR /&gt;&lt;BR /&gt;It sounds like the issue is that the extra line feed is making its way into the HTTP request itself. When the resulting HTTP request is interpreted, that extra new line is interpreted as separating the headers from the body, causing the unexpected file data.&lt;BR /&gt;&lt;BR /&gt;I'm not sure if we'll be able to detect and handle that on our side, so do make sure you don't put that in on your side.&lt;BR /&gt;&lt;BR /&gt;Whatever HTTP client you're using doesn't seem to catch this for you, but some HTTP libraries apparently do. For example, the Python requests library stops you from doing this by throwing a "ValueError: Invalid header value" exception.</description>
      <pubDate>Mon, 12 Jun 2017 20:37:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/No-error-message-with-line-feed-in-json-header/m-p/225443#M12234</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-06-12T20:37:15Z</dc:date>
    </item>
  </channel>
</rss>

