Skip to content

How to get response.data #153

Open
Open

Description

@mkalyon

Hi,
I use following get function, but I couldnt get response data to outside.

var mdata="";
var url="xxxxxxx";
cordovaHTTP.get(url, {

	}, { Authorization: "OAuth2: token" }, function(response) {
		response.data=JSON.parse(response.data);
		alert(response.data); // return response.data
		mdata=response.data;
	}, function(response) {
		alert(response.error);
	});

alert(mdata); // empty

First alert return response.data but second alert is empty.

How get response.data.

Thanks
Best Regards

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions