Problems with HTTP POST X-www-form-urlencoded key with dots or _
-
Hi All,
When I do a HTTP POST request with the following item:
postData.addQueryItem("com.collibra.dgc.core.dto.io.connector.JSONDataTableOutputConnectorFactory_sEcho", "0");
I get a response that the parameter isn't set.
Is it possible that the cause of this issue is because there are dots or underscores in the key?
And how to solve this?I can do a POST request in Postman with this key and value.
Wkr,
Grove -
Hi and welcome to devnet,
Can you show the complete request build ?
Did you check what was sent ? -
Hi Sgaist and thanks,
request.setUrl(QUrl("https://url")); QUrlQuery postData; postData.addQueryItem("outputConnector", "com.collibra.dgc.core.dto.io.connector.JSONDataTableOutputConnectorFactory"); postData.addQueryItem("com.collibra.dgc.core.dto.io.connector.JSONDataTableOutputConnectorFactory_sEcho", "0"); request.setRawHeader("Authorization", headerData.toLocal8Bit()); request.setRawHeader("Content-Type", "application/x-www-form-urlencoded"); manager->post(request, postData.toString().toUtf8());
How can I check was is send?
-
Hi Sgaist and thanks,
request.setUrl(QUrl("https://url")); QUrlQuery postData; postData.addQueryItem("outputConnector", "com.collibra.dgc.core.dto.io.connector.JSONDataTableOutputConnectorFactory"); postData.addQueryItem("com.collibra.dgc.core.dto.io.connector.JSONDataTableOutputConnectorFactory_sEcho", "0"); request.setRawHeader("Authorization", headerData.toLocal8Bit()); request.setRawHeader("Content-Type", "application/x-www-form-urlencoded"); manager->post(request, postData.toString().toUtf8());
How can I check was is send?
@grove said in Problems with HTTP POST X-www-form-urlencoded key with dots or _:
How can I check was is send?
Wireshark is your friend (network traffic capture/analyzer)
-
Is there a way to let tell Qt what is send?
Because i'm on a VPN line and it's a ssl connection it's not easy to get the data@grove said in Problems with HTTP POST X-www-form-urlencoded key with dots or _:
Because i'm on a VPN line and it's a ssl connection it's not easy to get the data
Just for debugging purposes, change the URL to some local non-SSL test server and capture the traffic then.