Android Question [solved] okhttp not removing headers in a POST request

DonManfred

Expert
Licensed User
B4X:
Sub GetThumbnail(path As String, format As String, size As String)
    Dim job As HttpJob
    job.Initialize("getthumbnail",Me)
    job.Tag = path
    job.PostString(mApiV2urlContent&"files/get_thumbnail","")
    job.GetRequest.SetHeader("Authorization", "Bearer "&mAccessToken)
    job.GetRequest.SetHeader("Dropbox-API-Arg", $"{"path":"${path}","format":"${format}","size":"${size}"}"$)
    'job.GetRequest.SetContentEncoding("text/plain")
    job.GetRequest.RemoveHeaders("Content-Type")
End Sub
I would expect to get the Content-Type header removed. But i get an error told from Dropbox

Error in call to API function "files/get_thumbnail": You provided a non-empty HTTP "Content-Type" header ("application/x-www-form-urlencoded"). This API function requires that the header be missing or empty.
I´m using httputils2 2.10 and okhttp lib 0.95
 
Top