Reading a file in repository in bitbucket cloud

AP.require(‘request’, function(request) {

  	function getFile(path) {
  			var x = request({
	          	url: '/1.0/repositories/{}/' + repoUuid + '/raw/HEAD/' + path,
	          	success: function (data) {
	          	error: function (i) {
	          		console.log("err", i)

In the above code, the “data” parameter is always undefined. When i check the network tab in chrome, I can see the file getting served.

Hi damojay,
Sorry for the delayed response. Were you able to resolve this issue?

If not, is this the exact code that you’re using?

Development Team Lead, Bitbucket Cloud