Retrofit and Jackson and parsing JSON

前端 未结 2 1628
攒了一身酷
攒了一身酷 2021-02-02 13:48

I am using Retrofit with Jackson. For some reasons I cannot parse the following JSON:

[
    {
        \"ProfileImage\": null,
        \"UserName\": \"joe\"
    }         


        
2条回答
  •  太阳男子
    2021-02-02 14:40

    with new versions of OkHTTP it seems its done with:

    Retrofit retrofit = new Retrofit.Builder()
                    .baseUrl(API_URL)
                    .addConverterFactory(JacksonConverterFactory.create())
                    .build();
    

提交回复
热议问题