Proba naprawienia

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2021-01-08 16:03:35 +01:00
parent c6c67e7e29
commit 149796c42a
Signed by: y0rune
GPG Key ID: F204C385F57EB348

View File

@ -55,14 +55,18 @@ public class UsosApiService {
final OAuthRequest request = new OAuthRequest(Verb.GET, apiUrl + "/services/users/user?user_id=" + usosId); final OAuthRequest request = new OAuthRequest(Verb.GET, apiUrl + "/services/users/user?user_id=" + usosId);
service.signRequest(new OAuth1AccessToken("", ""), request); service.signRequest(new OAuth1AccessToken("", ""), request);
System.out.println("PRZED TRY");
try (Response response = service.execute(request)) { try (Response response = service.execute(request)) {
System.out.println("TRY");
final String json = response.getBody(); final String json = response.getBody();
final ObjectMapper mapper = new ObjectMapper(); final ObjectMapper mapper = new ObjectMapper();
Map<String, String> map = mapper.readValue(json, new TypeReference<Map<String, String>>() { Map<String, String> map = mapper.readValue(json, new TypeReference<Map<String, String>>() {
}); });
System.out.println("FIELD");
apiResponse.setName(map.get(NAME_FIELD)); apiResponse.setName(map.get(NAME_FIELD));
System.out.println(map.get(NAME_FIELD));
apiResponse.setSurname(map.get(SURNAME_FIELD)); apiResponse.setSurname(map.get(SURNAME_FIELD));
System.out.println(map.get(SURNAME_FIELD));
} }
} catch (IOException | InterruptedException | ExecutionException e) { } catch (IOException | InterruptedException | ExecutionException e) {
e.printStackTrace(); e.printStackTrace();