Tag Archives: rest

RestEasy Response does not contain all headers like Content-Length

Questions: I have a resteasy Client that does an Async call with an InvocationCallback that is getting the response back in the completed() method. When i look into the response object in debug or do response.getHeaders() I only get two Content-Type:application/json Server:Jetty(6.1.26) In Debug mode when i look into the log I get 2018-08-10 11:48:46,603… Read More »

consuming uri with jwt Token using REST in springboot

Questions: I have a “jwt token” given by some third party source and “URI”, while consuming this I’m using “RestTemplate”. My code looks like below: @GetMapping(“/xyz”) public String account(){ HttpHeaders headers=new HttpHeaders(); headers.set(“Authorization”, “Bearer “+ token); headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); HttpEntity<String> entity=new HttpEntity<String>(headers); String responseEntity = this.restTemplate.getForObject(My_SERVICE_URI, String.class, entity); return responseEntity; } I have hardcoded URl and JWT… Read More »

How to do Google REST drive API batch request

Questions: I’m currently building an android app which lets the user to browse through a public shared google drive folder, the problem is that when a folder contains a large amount of files(<100), app gets too much time to get their metadata. What i’m do now is first retrieve the file ID’s in the folder,… Read More »

getting posted data from REST API

Questions: I created a rest APi for my website. The GET methods are working fine. For POST method, api is not getting the data posted back to it. I wrote this code but its giving error due to Notice: Trying to get property of non-object in $response = file_get_contents(‘http://myapi.com/object/post.php’); $data = json_decode($response); $object->id = $data->id;… Read More »

JIRA rest API to fetch board using only board name

Questions: I am working on speech-to-text application which is based on Java. In which I need to create a JIRA ticket in a particular board. For this I have only board name available as a input. So what I am looking for is there any JIRA rest-api available through which I can fetch that particular… Read More »

Spring, JPA and Rest and Duplicate entry for key 'PRIMARY'

Questions: I’m just starting to learn Spring and JPA and I’ve run into a bit of a wall trying to figure out what is causing my app to try and insert cascaded values in multiple times. I have the following structure: pom.xml <?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>com.test</groupId> <artifactId>core</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging>… Read More »

Button from an AlertDialog not restoring in onResume()

Questions: I have an AlertDialog which has some input text boxes, if some event that forces them to go in the events onSaveInstance, onResume, like a whatsapp popup notification, its content is lost so I’ve to save them and restore them in onResume(). As an extra effect for some reason, if I’ve a dialog which… Read More »

Chain of REST path in spring boot controller

Questions: I develope RESTful back-end app with spring boot. I find out how to use annotation in the class: @RestController @RequestMapping(path = “/users”) public class User{ // rest of code! } But every user has orders and any orders has items! So I design rest API like this: /users /users/{user_id} /users/{user_id}/orders /users/{user_id}/orders/{order_id} /users/{user_id}/orders/{order_id}/items /users/{user_id}/orders/{order_id}/items/{item_id} /users/{user_id}/cart… Read More »