Skip to content
Snippets Groups Projects
Commit 17c59cbe authored by NTUMBA WA NTUMBA Patient's avatar NTUMBA WA NTUMBA Patient
Browse files

Update REST API

parent c04f79e8
No related branches found
No related tags found
No related merge requests found
......@@ -230,9 +230,15 @@ public class BcRestSubcomponent extends BcGmSubcomponent {
break;
}
printermsg = (request.toString());
if(request.getMethod().equals(Method.GET)){
printermsg = (request.toString());
}else{
printermsg = (request.getEntityAsText());
}
logger.i(this.getClass().getName() + "[request]", printermsg);
logger.i(this.getClass().getName() + "[request Entity]", request.getEntityAsText());
Response response = this.client.handle(request);
try {
......@@ -242,7 +248,7 @@ public class BcRestSubcomponent extends BcGmSubcomponent {
e.printStackTrace();
}
printermsg = (response.getEntityAsText());
printermsg = response.getStatus().toString();
logger.i(this.getClass().getName() + "[response]", printermsg);
return (T) response.getEntityAsText();
......@@ -351,6 +357,7 @@ public class BcRestSubcomponent extends BcGmSubcomponent {
receivedText = entity.getText();
} catch (IOException e1) {
e1.printStackTrace();
}
// System.err.println(receivedText);
......
......@@ -111,8 +111,6 @@
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
......@@ -216,8 +214,6 @@
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment