how to add header and write-byte in retrofit

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



how to add header and write-byte in retrofit



here is my code i want to move in retrofit how to define all property in retrofit it work fine but when i call api in retrofit responses say add required filed but i pass all filed



how to define this property in retrofit


conn.setRequestProperty("http.keepAlive", "false");
conn.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary);



here it's byte how to define in retrofit


outputStream.writeBytes(twoHyphens + boundary + lineEnd);
outputStream.writeBytes("Content-Disposition: form-data; name="json"" + lineEnd);
outputStream.writeBytes("Content-Type: text/plain;charset=UTF-8" + lineEnd);
outputStream.writeBytes("Content-Length: " + req.length() + lineEnd);
outputStream.writeBytes(lineEnd);
outputStream.writeBytes(req + lineEnd);
outputStream.writeBytes(twoHyphens + boundary + lineEnd);
outputStream.writeBytes(twoHyphens + boundary + lineEnd);









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered