我想知道如何从凌空android的标头中获取默认的内容类型
我没有提到内容类型的地方,所以如何获得默认的内容类型。
最佳答案
I just append text fields to the body and created the following function to do it in multipart :
private void buildTextPart(DataOutputStream dataOutputStream, String
parameterName, String parameterValue) throws IOException {
dataOutputStream.writeBytes(twoHyphens + boundary + lineEnd);
dataOutputStream.writeBytes("Content-Disposition: form-data; name=\"");
dataOutputStream.write(parameterName.getBytes("UTF-8"));
dataOutputStream.writeBytes(lineEnd);
dataOutputStream.writeBytes("Content-Type: text/plain; charset=UTF-8" +
lineEnd);
dataOutputStream.writeBytes(lineEnd);
dataOutputStream.write(parameterValue.getBytes("UTF-8"));
dataOutputStream.writeBytes(lineEnd)
}
here mention multipart data format ,and text format as utf8,its working fine
关于android - 如何获取默认内容类型的Android Volley,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47654996/