Excel al CS
Questo file excel REST API saveas
in CSV.
POST /cells/{nome}/saveAs API consente di salvare il file MS Excel come file CSV con impostazioni aggiuntive e salvare il risultato nella memoria.
Questo file excel REST API convert
in CSV.
PUT /celle/converti API consente di convertire il file MS Excel in un file CSV con impostazioni aggiuntive e di salvare il risultato nella risposta.
Questo file excel REST API export
in CSV.
OTTIENI /celle/{nome} API consente di convertire il file MS Excel in un file CSV con impostazioni aggiuntive e di salvare il risultato nella risposta.
RIPOSO API
API
Tipo
Descrizione
Collegamento spavaldo
/celle/converti
METTERE
Converte la cartella di lavoro dal contenuto della richiesta in un formato
PutConvertWorkBook
/celle/{nome}
OTTENERE
Esporta la cartella di lavoro in un altro formato.
GetWorkBook
/cells/{nome}/saveAs
INVIARE
Esporta cartella di lavoro in formato
PostDocumentoSalva con nome
Queste API definiscono un’interfaccia di programmazione accessibile pubblicamente e consentono di eseguire interazioni REST direttamente da un browser web.
Puoi usarecURL strumento da riga di comando per accedere facilmente ai servizi Web Aspose.Cells. L’esempio seguente mostra come effettuare chiamate a Cloud API con cURL.
Famiglia di SDK cloud
L’utilizzo di un SDK è il modo migliore per velocizzare lo sviluppo. Un SDK si occupa dei dettagli di basso livello e ti consente di concentrarti sulle attività del tuo progetto. Si prega di controllare ilDeposito GitHub per un elenco completo di Aspose.Cells Cloud SDK.
I seguenti esempi di codice mostrano come effettuare chiamate ai servizi Web Aspose.Cells utilizzando vari SDK:
C#
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/
Aspose . Cells . Cloud . SDK . Api . CellsApi cellsApi = new CellsApi ( "your client id" , "your client secret" );
var response = cellsApi . CellsWorkbookPutConvertWorkbook ( File . OpenRead ( @".\TestData\datasource.xlsx" ), "csv" , null , null );
Assert . IsInstanceOf < System . IO . Stream >( response , "response is System.IO.Stream" );
Java
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-java/
try {
LightCellsApi liteApi = new LightCellsApi ( System . getenv ( "CellsCloudTestClientId" ), System . getenv ( "CellsCloudTestClientSecret" ));
String AssemblyTestXlsx = "assemblytest.xlsx" ;
String DataSourceXlsx = "datasource.xlsx" ;
HashMap < String , File > fileMap = new HashMap < String , File >();
fileMap . put ( AssemblyTestXlsx , new File ( "TestData\\" + AssemblyTestXlsx ));
fileMap . put ( DataSourceXlsx , new File ( "TestData\\" + DataSourceXlsx ) );
FilesResult response = liteApi . postExport ( fileMap , "workbook" , "csv" );
} catch ( ApiException e ) {
e . printStackTrace ();
}
//2. solution
try {
CellsApi api = new CellsApi ( System . getenv ( "CellsCloudTestClientId" ), System . getenv ( "CellsCloudTestClientSecret" ));
File response = api . cellsWorkbookPutConvertWorkbook (
new File ( "TestData\\Book1.xlsx" ), "csv" , null , null );
} catch ( ApiException e ) {
e . printStackTrace ();
}
Go
LightCellsAPI := NewLightCellsApiService ( clientId , clientSecret )
var fileMap map [ string ] string
fileMap = make ( map [ string ] string )
fileMap [ "Book1.xlsx" ] = "TestData\\Book1.xlsx"
fileMap [ "Book2.xlsx" ] = "TestData\\Book2.xlsx"
postOpts := new ( PostExportOpts )
postOpts . Format = "csv"
postOpts . ObjectType = "workbook"
_ , httpResponse , err := LightCellsAPI . PostExport ( fileMap , postOpts )
if err != nil {
t . Error ( err )
} else if httpResponse . StatusCode < 200 || httpResponse . StatusCode > 299 {
t . Fail ()
} else {
fmt . Printf ( "\tTestCellsPostExport \n" )
}
CellsAPI := NewCellsApiService ( clientId , clientSecret )
args := new ( CellsWorkbookPutConvertWorkbookOpts )
args . Format = "csv"
file , err := os . Open ( "TestData\\Book1.xlsx" )
if err != nil {
return
}
localVarReturnValue , httpResponse , err := CellsAPI . CellsWorkbookPutConvertWorkbook ( file , args )
if err != nil {
t . Error ( err )
} else if httpResponse . StatusCode < 200 || httpResponse . StatusCode > 299 {
t . Fail ()
} else {
fmt . Printf ( "\t TestCellsPutConvertWorkbook - %d\n" , httpResponse . StatusCode )
}