Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I have this code for HTTP get Method. I'm using currency as a parameter that is required but I would like to add optional parameters for time and date wich are also included in the API. How do I do that?

$scope.$watch('codeMod', function(newSelectedCurreny) {
   $http({
    method: 'jsonp',
    url: 'http://lari.jumpstart.ge/en/api/v1/nbg_rates?callback=JSON_CALLBACK',
    params: { currency: newSelectedCurreny }
}).success(function(data, status , header, config) {
    console.log('success');
       $scope.result = data.result;
        console.log('success');
}).error(function(data, status , header, config) {
    console.log('error');
});
                   })
share|improve this question
2  
Your API should handle the optionnal parameter and the HTTP should only sent what it need to send – Weedoze Jul 20 at 12:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.