File tree Expand file tree Collapse file tree
src/main/java/com/recombee/api_client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77 <groupId >com.recombee</groupId >
88 <artifactId >api-client</artifactId >
9- <version >1.2.4</version >
9+ <version >1.2.4.1 </version >
1010 <name >Recombee API Client</name >
1111 <description >A client library for easy use of the Recombee recommendation API</description >
1212 <url >http://recombee.com</url >
2929 <developer >
3030 <id >ondra_fiedler</id >
3131 <name >Ondrej Fiedler</name >
32- <email >ondrj .fiedler@recombee.com</email >
32+ <email >ondrej .fiedler@recombee.com</email >
3333 <url >https://github.com/OndraFiedler</url >
3434 <organization >Recombee</organization >
3535 <organizationUrl >http://recombee.com</organizationUrl >
Original file line number Diff line number Diff line change 33import com .fasterxml .jackson .core .JsonProcessingException ;
44import com .fasterxml .jackson .databind .ObjectMapper ;
55import com .fasterxml .jackson .core .type .TypeReference ;
6+ import java .text .SimpleDateFormat ;
7+
68import com .mashape .unirest .http .HttpResponse ;
79import com .mashape .unirest .http .Unirest ;
810import com .mashape .unirest .http .exceptions .UnirestException ;
@@ -73,6 +75,8 @@ public RecombeeClient(String databaseId, String token) {
7375 this .databaseId = databaseId ;
7476 this .token = token ;
7577 this .mapper = new ObjectMapper ();
78+ SimpleDateFormat df = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss'Z'" );
79+ this .mapper .setDateFormat (df );
7680
7781 if (System .getenv ("RAPI_URI" ) != null )
7882 this .baseUri = System .getenv ("RAPI_URI" );
@@ -605,7 +609,7 @@ private HttpRequest delete(String url) {
605609
606610 private HttpRequest post (String url , Request req ) {
607611 try {
608- String json = new ObjectMapper () .writeValueAsString (req .getBodyParameters ());
612+ String json = this . mapper .writeValueAsString (req .getBodyParameters ());
609613 return Unirest .post (url ).header ("Content-Type" , "application/json" ).
610614 body (json .getBytes ()).getHttpRequest ();
611615 } catch (JsonProcessingException e ) {
You can’t perform that action at this time.
0 commit comments