Elastic search api call issue

Authentication exception while posting json file in elastic search server. Our database is 12c and we are using utl_http utility to post json from oracle database. The error message is as below,

{"error":"AuthenticationException[unable to authenticate user [http] for REST request [//ogrds_chr/chr1/_bulk]]","status":401}.

Elastic search server is authorized with usename and password and the same has been provided in the utl_http request.

It was working fine in 11g but after 12c migration the same is not working.

sample code used for elastic search call:-
utl_http.begin_request('http://username:password@url:port/es_chr/chr1/12450'
,'POST'
, 'HTTP/1.1');

Let me know any suggestions.