It's all about the answers!

Ask a question

Getting html Repose when try to login into RTC using Postman

gaurao khadse (152) | asked Jan 28 '21, 12:33 a.m.

I try to get defect and post a defect using rest api.

When i try with postman its working fine.
But while try using java code using jersey rest client, its gives me html page as response.
Header values I set as below in the sample code.     
                RestRequest request = new RestRequest();
request.getHeaders().put("Accept", "application/json");
request.getHeaders().put("Authorization", "Basic anlvdGk6anlvdGk=");

Response :
status - 200 and below html page
<!DOCTYPE html>
  Licensed Materials - Property of IBM
  (c) Copyright IBM Corporation 2005, 2015. All Rights Reserved.
  Note to U.S. Government Users Restricted Rights:
  Use, duplication or disclosure restricted by GSA ADP Schedule
  Contract with IBM Corp.

<html >
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=10">

<link type="text/css" rel="stylesheet" href="/ccm/web/_style/?include=A~&etag=JLGO3lIcQGU_en_US&_proxyURL=%2Fccm&ss=MEwIR">
<link rel="shortcut icon" href="/ccm/web/net.jazz.ajax/jazz.ico">

<style type="text/css">
#net-jazz-ajax-NoScriptMessage {
width: 100%;
color: #D0D0D0;
font-size: 2em;
text-align: center;
position: absolute;
top: 1%;
z-index: 999;


<body class="claro">
<noscript><div id="net-jazz-ajax-NoScriptMessage">Javascript is either disabled or not available in your Browser</div></noscript>
<div id="net-jazz-ajax-InitialLoadMessage">Loading...</div>
<div id="net-jazz-ajax-WorkbenchRoot"></div>
<script type="text/javascript">
djConfig = {
isDebug: false,
layout: "",
usePlainJson: true,
baseUrl: "/ccm/web/dojo/",
locale: "en-us",
localizationComplete: true
net = {jazz: {ajax: {}}};
net.jazz.ajax._contextRoot = "/ccm";
net.jazz.ajax._appPath = "/ccm/auth/authrequired";
net.jazz.ajax._webuiPrefix = "/web/";
<script type="text/javascript" src="/ccm/web/_js/?include=A~&etag=JLGO3lIcQGU_en_US&_proxyURL=%2Fccm&ss=MEwIR&locale=en-us"></script>

<script type="text/javascript">
require("dojo/main").getObject('jazz.core.loader', true)._serverStartup="MEwIR";

<script type="text/javascript">
/ <![CDATA[ /
dojo.addOnLoad( function() {
/ ]]> /


One answer

permanent link
Ralph Schoon (59.6k23643) | answered Jan 28 '21, 6:02 a.m.

 You have to be authorized, which you are apparently not (""). See use form auth.

Note: the response 200 is not enough, the location header in the response must not be "/auth/authfailed" either.

Your answer

Register or to post your answer.