@@ -144,11 +144,19 @@ var GraphRequest = (function () {
144144 } ;
145145 GraphRequest . prototype . patch = function ( content , callback ) {
146146 var url = this . buildFullUrl ( ) ;
147- return this . sendRequestAndRouteResponse ( new Request ( url , { method : RequestMethod_1 . RequestMethod . PATCH , body : content , headers : new Headers ( ) } ) , callback ) ;
147+ return this . sendRequestAndRouteResponse ( new Request ( url , {
148+ method : RequestMethod_1 . RequestMethod . PATCH ,
149+ body : content ,
150+ headers : new Headers ( ( { 'Content-Type' : 'application/json' } ) )
151+ } ) , callback ) ;
148152 } ;
149153 GraphRequest . prototype . post = function ( content , callback ) {
150154 var url = this . buildFullUrl ( ) ;
151- return this . sendRequestAndRouteResponse ( new Request ( url , { method : RequestMethod_1 . RequestMethod . POST , body : content , headers : new Headers ( ) } ) , callback ) ;
155+ return this . sendRequestAndRouteResponse ( new Request ( url , {
156+ method : RequestMethod_1 . RequestMethod . POST ,
157+ body : content ,
158+ headers : new Headers ( ( { 'Content-Type' : 'application/json' } ) )
159+ } ) , callback ) ;
152160 } ;
153161 GraphRequest . prototype . put = function ( content , callback ) {
154162 var url = this . buildFullUrl ( ) ;
@@ -246,8 +254,8 @@ var GraphRequest = (function () {
246254 GraphRequest . prototype . configureRequest = function ( request , accessToken ) {
247255 var _this = this ;
248256 request . headers . append ( 'Authorization' , 'Bearer ' + accessToken ) ;
249- Object . keys ( this . _headers ) . forEach ( function ( key ) { return request . headers . append ( key , _this . _headers [ key ] ) ; } ) ;
250257 request . headers . append ( 'SdkVersion' , "graph-js-" + packageInfo . version ) ;
258+ Object . keys ( this . _headers ) . forEach ( function ( key ) { return request . headers . set ( key , _this . _headers [ key ] ) ; } ) ;
251259 return request ;
252260 } ;
253261 GraphRequest . prototype . query = function ( queryDictionaryOrString ) {
0 commit comments