For sending a message to a Cisco VoIP Phone
, I use Apache HttpClient
:
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new StringEntity(body, ContentType.TEXT_XML));
httpPost.addHeader(new BasicScheme().authenticate(usernamePasswordCredentials, httpPost, null));
The XML
message looks like this
String body =
"""
XML=
<CiscoIPPhoneText>
<Title>...</Title>
<Prompt>...</Prompt>
<Text>...</Text>
</CiscoIPPhoneText>
""";
The URL
used is with IP
adress like
String url = "https://<ip-adress>/CGI/Execute";
Wenn executing the POST
request
HttpResponse response = closeableHttpClient.execute(httpPost);
I recieve status code 400
and
<CiscoIPPhoneError Number="1"></CiscoIPPhoneError>
I don't know what that means and what the problem is with the POST
request.
The authentication seams to have been successful, because if I remove the part httpPost.addHeader(new BasicScheme()...
then I get 401
.