Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mr_novice
Creator II
Creator II

Yet another REST connector problem!

Hi All,

First of all Im using QlikSense Business Cloud. I create a REST-connector with the POST method and it works fine. I see the desired results. The connection works. Then Im including the data from the connector through the icon "Choose data" and then "insert script". Here I also see the correct results. I see that it is receiving the correct results. BUT, when I load the app I get this error: "QVX_UNEXPECTED_END_OF_DATA: HTTP protocol error 400 (Bad Request): Bad Request"

Why?

Any suggestions how to move on from here?

Br

Cristian

1 Solution

Accepted Solutions
mr_novice
Creator II
Creator II
Author

ok. This doesnt work. But, I created another script. This is to get the latest token that I need to use in another connection:

LIB CONNECT TO 'DummyPostConnection';

SET vRequestBody = '{"username":"abcde","password":"abcde"}';

let vRequestBody = replace(vRequestBody,'"', chr(34)&chr(34));

RestConnectorMasterTable:

SQL SELECT

"col_1"

FROM CSV (header off, delimiter ",", quote """") "CSV_source"

WITH CONNECTION (

    URL "https://X/Login.ashx/",

    HTTPHEADER "Content-Type" "application/json",

  BODY "$(vRequestBody)"

  )

;

[CSV_source]:

LOAD [col_1] AS [col_1]

RESIDENT RestConnectorMasterTable;

DROP TABLE RestConnectorMasterTable;

LET vToken = peek('col_1',0,'CSV_source');

Drop table CSV_source;

View solution in original post

2 Replies
mr_novice
Creator II
Creator II
Author

These are the settings:

Skärmavbild 2017-10-23 kl. 23.52.06.png

Skärmavbild 2017-10-23 kl. 23.50.31.png

Skärmavbild 2017-10-23 kl. 23.52.27.png

The inserted script:

LIB CONNECT TO 'GetNewToken';

RestConnectorMasterTable:

SQL SELECT

"col_1"

FROM CSV (header off, delimiter ",", quote """") "CSV_source";

[CSV_source]:

LOAD [col_1] AS [col_1]

RESIDENT RestConnectorMasterTable;

DROP TABLE RestConnectorMasterTable;

The error when loading:

Skärmavbild 2017-10-23 kl. 23.55.06.png

mr_novice
Creator II
Creator II
Author

ok. This doesnt work. But, I created another script. This is to get the latest token that I need to use in another connection:

LIB CONNECT TO 'DummyPostConnection';

SET vRequestBody = '{"username":"abcde","password":"abcde"}';

let vRequestBody = replace(vRequestBody,'"', chr(34)&chr(34));

RestConnectorMasterTable:

SQL SELECT

"col_1"

FROM CSV (header off, delimiter ",", quote """") "CSV_source"

WITH CONNECTION (

    URL "https://X/Login.ashx/",

    HTTPHEADER "Content-Type" "application/json",

  BODY "$(vRequestBody)"

  )

;

[CSV_source]:

LOAD [col_1] AS [col_1]

RESIDENT RestConnectorMasterTable;

DROP TABLE RestConnectorMasterTable;

LET vToken = peek('col_1',0,'CSV_source');

Drop table CSV_source;