We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

ingconti's avatar
ingconti
Helpful | Level 5
3 years ago

Re: Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg":

good you are available

Said so, pls let me know How to fix it.

to recap:

a) my ap is written in swift, NO other components (neither official dropbox library, too big and too messy)

b) it did work since 2 month ago. now I got error

c) if I cannot see WHAT has been broken, pls sent me HINTS about, OR let mr speak with some tech guy of upper level, to get some helpful tips.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:

    • the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
    • the full text of any error or unexpected output
    • ingconti's avatar
      ingconti
      Helpful | Level 5

      this is my Swift code:

       

          case .Upload:

              

              var optionsStr = "{\"path\": \"PATH_PLACEHOLDER\",\"mode\": \"add\",\"autorename\": AUTORENAME_PLACEHOLDER, \"mute\": false,\"strict_conflict\": false}"

              optionsStr = optionsStr.replacingOccurrences(of: "PATH_PLACEHOLDER", with: remotePath!)

              let autoRename = autoRenameOnServer ? "true" : "false"

              optionsStr = optionsStr.replacingOccurrences(of: "AUTORENAME_PLACEHOLDER", with: autoRename)

              #if DEBUG

              print("header:   ", optionsStr, "\n")

              #endif

              

              request.setValue(optionsStr,                 forHTTPHeaderField: "Dropbox-API-Arg")

              request.setValue("application/octet-stream", forHTTPHeaderField: "Content-Type")

       

       

      And I send it AS other cases (for example LIST)

       

      the above code is for uploading.

       

      As said, it worked a couple of weeks ago and for more than 2 years.

       

      SO the unique reason is Siem Apis is changed OR other inner things, but NO decent details.,

       

       

      • ingconti's avatar
        ingconti
        Helpful | Level 5

        to be cleat: after this code we issued the USUAL, beloved, apple-endorsed code:

         

          let session = URLSession.shared

            

            let task = session.dataTask(with: request as URLRequest, completionHandler: {data, response, error -> Void in

                

             ......