I am attempting to use okhttp-3.12.0 and okio-1.9.0 in my JAVA project to make POST call to a web service.
I am able to successfully create the record, however, the web service returns a response of data type long which then throws a NoSuchMethodError because the OkHttp library tries to read it with readUtf8LineStrict.
Can someone with more experience advise me on how to work through this problem? Do I need to make changes to the underlying library or should I take a different approach?
Response response = client.newCall(request).execute();
System.out.println(response);
{"recordId":"ABC123DEFZhC8O_KS8V2mkWPXreXpLHFZgSIyjH5Ue9Z4sUDe4ghkWsZcYlh55lrSTooSstxgMouuleKr0TqjYzuE2Xjz8OWBvxwAc8uLyJNm0TF1fUGwBz9_nrIgpsHcr-lwwQzOvxpCBwE-NV-NIym5ZLE5SgmO4jty0fUEld4kHt7yOL2_94-jTavICTwMsIaPfvXxx74Cox4R_lONNlmd2R8BSLhGHxLW-Hfh-fLZhOmPMF-2zmXQm2h3Poj-SI6PY_f7F2tLmEyR92JR33QFfVVOmRgJ5mC0U5adG_BXyKlREvlQIiwtvEQY3InIjlJZw0mpYAEY4VD7QmOPfGWYpwgUwqZELmVPIESrq2dT3LHIdfPLBQ**"}
Exception in thread "main" java.lang.NoSuchMethodError: 'java.lang.String okio.BufferedSource.readUtf8LineStrict(long)'
I was able to receive a long text response by updating the libraries I was using.
These two libraries are the most up to date versions I could work WITHOUT Kotlin.