Question: I'm trying to make a GET to my endpoint and print data in my page

```
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>

<div ng-app="myApp" ng-controller="myCtrl">

  <p>Data is:</p>
  <h1>{{myData}}</h1>

</div>

<script>
  var app = angular.module('myApp', []);
  app.controller('myCtrl', function($scope, $http) {

    var promise = $http({
      method: 'GET',
      url: 'http://d.biossusa.com/api/distributor?key=*****',
      dataType: 'jsonp',
    });

    promise.success(function (data, status, header, config) {
      console.log("status is ", status);
      console.log(config.method + " data is: " + config.data);
      console.log("data is ", data);
      $scope.myData = response.data;

    });

  });

</script>

```

---

I kept getting 

[![enter image description here](https://i.stack.imgur.com/vmzJ4.png)](https://i.stack.imgur.com/vmzJ4.png)

I am expected to get the data printing out ! 

<https://jsfiddle.net/bheng/b3rgh92v/>

When I curl this url : <http://d.biossusa.com/api/distributor?key=>\*\*\*\*\*

I got the result fine ! 

[![enter image description here](https://i.stack.imgur.com/dbw0U.jpg)](https://i.stack.imgur.com/dbw0U.jpg)

What did I do wrong on my angular ? Any hints ?

Answer: 
Few observations:

1): Make sure you have added the reference of your script file in your html if you are using external file (where you are creating angular module).

2): Remove response from your assignment 

```
$scope.myData = response.data;  //response is undefined, so remove it

```

It should be 

```
$scope.myData = data;

```

3) Lastly, make sure you are allowed to call that endpoint [I get an error saying I can't call http endpoint from plnkr's HTTPS endpoint so I updated the GET URL]. I tried your code in plunker with a different URL and it worked ok with the above changes. Here is [plnkr link](https://plnkr.co/edit/QflW6MaxC36qD9wkOWcF?)
I read your code on fiddle and observe some problem

### 1. Angular module not found problem

In your example you add `<script>` tag in script saction. You don't need add `<script>` tag in that saction because that already add inside a `<script>` saction.

Also your JavaScript code run `onload` event, so when angular bootstrapping, module not available. So change it to `No wrap - in <body>` by JavaScript setting available in JavaScript section right top.

### 2. Calling request to `http` server from `https` server

> 
> ERROR : Mixed Content: The page at '<https://jsfiddle.net/b3rgh92v/>' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '<http://d.biossusa.com/api/distributor?key=>\*\*\*\*\*'. This request has been blocked; the content must be served over HTTPS.
> 
> 
> 

You can call `https` request from non `https` server but you can't call a non `https` server request from `https` server. You need to request on `https` server only from `https`

I have changed url to some another testing api on `https` server. It's working fine.

You can check updated code on 
<https://jsfiddle.net/b3rgh92v/11/>