如何从改造中发送未编码的base64?

时间:2019-03-15 04:18:51

标签: android base64 retrofit

您好,我想通过改装将未编码的base64图像发送到Web。 我所编码的意思是将“ /”更改为%2F。但是我想发送未编码的正文。

同一图像的已编码和未编码的base64

例如(已编码)-

%2F9j%2F4AAQSkZJRgABAQAAAQABAAD%2F2wBDAA0JCgsKCA0LCgsODg0PEyAVExISEyccHhcgLikxMC4p%0ALSwzOko%2BMzZGNywtQFdBRkxOUlNSMj5aYVpQYEpRUk%2F%2F2wBDAQ4ODhMREyYVFSZPNS01T09PT09P%0AT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0%2F%2FwAARCABGAEYDASIA%0AAhEBAxEB%2F8QAGgAAAgMBAQAAAAAAAAAAAAAAAAIBAwYEBf%2FEACsQAAICAQIEBAYDAAAAAAAAAAAB%0AAgMRBCEFEjFRBjNBYSIyQoGR4RNicv%2FEABgBAQEBAQEAAAAAAAAAAAAAAAABAgME%2F8QAGREBAQEB%0AAQEAAAAAAAAAAAAAAAERAhID%2F9oADAMBAAIRAxEAPwDl9ScFrokns0K659jzY9OqyGh3CS6oUilY%0AkngsZXNZQGW41XKHEZza2sSa%2FGDhNRrdLXqoctmcro%2Bx5i4Fc5fDdHHujtz1MceubrymwNRouC6e%0AiLd6V02vVbL7AL9Ivivec9ujKZ24W0kXNFdkFJYaF5WVyz1c45wzj1PFbaapzUYPC9UdF2kUvlbi%0AeJximdFWJTypewnJej1%2BJbV52krl%2FmTR0Q8QaKfmU3Vv2w0Zo6NXbTdZGVFCpiopNd2a8Rj1Wo0u%0Aq0Wts5KNRmeM8sotM7I6acX1TRnvC9blr7LMbV14%2FL%2FRq013MXmNy1RySX0sDpQGPLWpaEaLRWju%0A5qZRM9x%2Bt22qr5cJNNrb1NK0LKuM48s4qS7NZCMBLTWw%2Blte25U01s019jcz4Vo5vm%2Fi5X%2FWTQQ4%0ATpVNP42uzlsXTHD4VpcdFbdJeZPC26pfts9zBMYqMVGKSitkkTgzVheWPZANgCYunaFaHDBtlXgj%0ABZgjBAuCcDYJwFLgMDYDAEYAkCBsBgANIMEYACAAAAAAADAAAH%2F%2F2Q%3D%3D%0A

未编码-

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAA0JCgsKCA0LCgsODg0PEyAVExISEyccHhcgLikxMC4p

    LSwzOko+MzZGNywtQFdBRkxOUlNSMj5aYVpQYEpRUk//2wBDAQ4ODhMREyYVFSZPNS01T09PT09P

    T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0//wAARCABGAEYDASIA

    AhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAIBAwYEBf/EACsQAAICAQIEBAYDAAAAAAAAAAAB

    AgMRBCEFEjFRBjNBYSIyQoGR4RNicv/EABgBAQEBAQEAAAAAAAAAAAAAAAABAgME/8QAGREBAQEB

    AQEAAAAAAAAAAAAAAAERAhID/9oADAMBAAIRAxEAPwDl9ScFrokns0K659jzY9OqyGh3CS6oUilY

    kngsZXNZQGW41XKHEZza2sSa/GDhNRrdLXqoctmcro+x5i4Fc5fDdHHujtz1MceubrymwNRouC6e

    iLd6V02vVbL7AL9Ivivec9ujKZ24W0kXNFdkFJYaF5WVyz1c45wzj1PFbaapzUYPC9UdF2kUvlbi

    eJximdFWJTypewnJej1+JbV52krl/mTR0Q8QaKfmU3Vv2w0Zo6NXbTdZGVFCpiopNd2a8Rj1Wo0u

    q0Wts5KNRmeM8sotM7I6acX1TRnvC9blr7LMbV14/L/Rq013MXmNy1RySX0sDpQGPLWpaEaLRWju

    5qZRM9x+t22qr5cJNNrb1NK0LKuM48s4qS7NZCMBLTWw+lte25U01s019jcz4Vo5vm/i5X/WTQQ4

    TpVNP42uzlsXTHD4VpcdFbdJeZPC26pfts9zBMYqMVGKSitkkTgzVheWPZANgCYunaFaHDBtlXgj

    BZgjBAuCcDYJwFLgMDYDAEYAkCBsBgANIMEYACAAAAAAADAAAH//2Q==

这些指向同一张图片,但我想发送第二张作为正文。我也尝试过在编码中加编码为true,但没有运气。

@FormUrlEncoded
    @POST("{id}/profile/uploadPicture")
    public fun uploadImage(
            @Path(value = "id", encoded = true) userId: Int,
            @Field(value = "picture" , encoded = true) picture:String)
            : Call<ImageUploadResponse>
}

0 个答案:

没有答案