12-04-2015 05:43 AM
hi ,
In Unity Connection 10.0 version i tried to Add local user and Import Active directory User but for both request iam getting the error like [Fatal Error] :1:1: Content is not allowed in prolog. iam using REST API to Add User for Post request only iam getting this error ,but USER is added into the server for DELETE ,PUT and GET request iam getting response 204. for POST Not getting any response code instead of this getting the above error what i mentioned.
my code
=============================================================
req = new CUPIRESTRequest( 'path': path , body: [ "Alias":"raghu","DtmfAccessId":"112233","FirstName":"Raghavendra","LastName":"Mankar","EmailAddress":"raghu@ymail.com" ], contentType: 'application/json' );
def res=client.post( req );
public Response post(CUPIRESTRequest cupiRequest) {
log.info "Executing CUPI Request For ${cupiRequest.path} - Start"
def res = client?.post(path: cupiRequest.path) {
type cupiRequest.contentType
json cupiRequest.body
}
log.info "Executing CUPI Request For ${cupiRequest.path} - Start"
return res;
}
======================================================================================
In cisco developer api given as follow
===============================
POST https://<Connection-server>/vmrest/users?templateAlias=voicemailusertemplate
Accept: application/json
Content_type: application/json
Connection: keep_alive
Request Body:
{
"Alias":"voicemailusertemplate1",
"DisplayName":"Voice Mail User Template 1"
}
Thanks,
12-04-2015 08:23 AM
From the raw HTTP request, it looks like 'Content_type' should be 'Content-Type'.
'Content is not allowed in prolog' is pretty indicative of an XML parser finding a problem with the very beginning of an XML document. I'm guessing that because of the malformed Content-Type header, VMREST defaults to assuming the content is XML, which fails to parse as the content is actually JSON.
12-07-2015 03:35 AM
hi ,
iam able to post the data and it is saved in server using my code but iam not getting any response from the server i tried to post a xml data but same problem iam facing...
thanks,
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide