Search code examples
angular-routinghttp-options-method

What's the correct way to send parameters from AngularJS to an Options HTTP API?


What's the right code to talk between an options HTTP API with parameters?

        return $http( {
            method: 'OPTIONS',
            url: apiUrl + '/Options/' + clientID
        } ).error( function ( a, b, c, d, e ) {
            console.log( 'a, b, c, d, e', a, b, c, d, e );
        } );

Solution

  • Try this way

            return $http( {
                method: 'OPTIONS',
                url: apiUrl + '/Options?clientID=' + clientID
            } ).error( function ( a, b, c, d, e ) {
                console.log( 'err' );
            } );