Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Requests for TestTrail



I am trying to receive “id” for my milestone in Test Trial

I am doing request:

public String getMilestoneID(String milestoneID) throws Exception {
    String new_milestone_ID  = new URIBuilder()
            .setHost(HOST + "/" + Requests.isMilestoneID + "/" + milestoneID)
    String ID = parsingJSON(TestHTTPUtils.executeGetRequest(String.valueOf(new_milestone_ID)));
    return ID;

My request:

public static String parsingJSON(byte[] json) throws ParseException {
String input = new String(json);
JsonParser parser = new JsonParser();
JsonObject mainObject = (JsonObject) parser.parse(input);
JsonObject pItem = (JsonObject) mainObject.get(“id”);
return pItem.get(“id”).toString();

And for input - i have: {“error”:“Content-Type header missing (use Content-Type: application/json)”}

Could you help me, please