@@ -242,13 +242,17 @@ export class TdeiClient extends BaseHttpClient implements ICancelableClient {
242242 }
243243
244244 async downloadOswDataset ( tdeiRecordId : string , format : string = 'osw' ) : Promise < Blob > {
245- const response = await this . _sendTest ( `osw/${ tdeiRecordId } ?format=${ format } ` , 'GET' ) ;
245+ const response = await this . _get ( `osw/${ tdeiRecordId } ?format=${ format } ` , {
246+ headers : { Accept : '*/*' } ,
247+ } ) ;
246248
247249 return ( await response . blob ( ) ) ;
248250 }
249251
250252 async downloadPathwaysDataset ( tdeiDatasetId : string ) : Promise < Blob > {
251- const response = await this . _sendTest ( `gtfs-pathways/${ tdeiDatasetId } ` , 'GET' ) ;
253+ const response = await this . _get ( `gtfs-pathways/${ tdeiDatasetId } ` , {
254+ headers : { Accept : '*/*' } ,
255+ } ) ;
252256
253257 return ( await response . blob ( ) ) ;
254258 }
@@ -328,16 +332,14 @@ export class TdeiClient extends BaseHttpClient implements ICancelableClient {
328332 const filename = sourceFormat === 'osw' ? 'osw.zip' : 'osm.xml' ;
329333 body . append ( 'file' , new File ( [ dataset ] , filename ) ) ;
330334
331- const jobResponse = await this . _sendTest ( 'osw/convert' , 'POST ', body ) ;
335+ const jobResponse = await this . _post ( 'osw/convert' , body ) ;
332336 const jobId = ( await jobResponse . text ( ) ) ;
333337
334338 while ( true ) {
335339 console . info ( `Waiting for dataset conversion job ${ jobId } ...` ) ;
336340 await new Promise ( resolve => setTimeout ( resolve , 4000 ) ) ;
337341
338- const statusResponse = await this . _get ( `jobs?job_id=${ jobId } &tdei_project_group_id=${ projectGroupId } ` , {
339- headers : { 'Accept' : 'application/text' }
340- } ) ;
342+ const statusResponse = await this . _get ( `jobs?job_id=${ jobId } &tdei_project_group_id=${ projectGroupId } ` ) ;
341343 const statusBody = ( await statusResponse . json ( ) ) [ 0 ] ;
342344 const statusText = statusBody . status . toLowerCase ( ) ;
343345
@@ -350,7 +352,9 @@ export class TdeiClient extends BaseHttpClient implements ICancelableClient {
350352 }
351353 }
352354
353- const fileResponse = await this . _sendTest ( `job/download/${ jobId } ` , 'GET' ) ;
355+ const fileResponse = await this . _get ( `job/download/${ jobId } ` , {
356+ headers : { 'Accept' : '*/*' } ,
357+ } ) ;
354358
355359 return await fileResponse . blob ( ) ;
356360 }
0 commit comments