1

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 );
        } );
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pakk
  • 1,299
  • 2
  • 18
  • 36
  • Please share the results you are getting – Rohit Gupta Jun 03 '15 at 22:54
  • The API url is completely dependent on the api. We cannot possibly know ahead of time what the correct endpoint needs to be unless you tell us what server you're trying to hit, like github, google maps etc. Many of these APIs have not implemented OPTIONS yet either. Also I don't think angular's `$http` has an `.options` shorthand so your second attempt looks more accurate. – azium Jun 04 '15 at 00:40
  • @azium , thanks for the reply, I just needed to know if its possible - the API is an In-house API and I know has parameters and has Options implemented, but for some reason my code isn't reaching the API code. Thanks - Ill keep trying – Pakk Jun 04 '15 at 13:33

1 Answers1

1

Try this way

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