# These examples can be used directly in VSCode, using REST Client extension (humao.rest-client)
# They are important, because used to generate the tests.hurl file.

# Décommenter/commenter les lignes voulues pour tester localement
# @host=http://localhost:31976
@host=https://data-wrapper.services.istex.fr

###
# @name v1Csv
# Convertit un CSV en .tar
POST {{host}}/v1/csv?id=title&value=rating HTTP/1.1
Content-Type: text/csv

title,year,director/firstName,director/LastName,actors,rating,imdb
Rocky,1976,John G.,Avildsen,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young,"8,1",http://www.imdb.com/title/tt0075148/
Rocky 2,1979,Sylvester,Stallone,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young/Burgess Meredith/Tony Burton/Frank Stallone/Stu Nahan,"7,2",http://www.imdb.com/title/tt0079817/
Rocky 3,1982,Sylvester,Stallone,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young/Burgess Meredith/Mister T./Hulk Hogan/Tony Burton,"6,7",http://www.imdb.com/title/tt0084602/
Last Action Hero,1993,John,McTierman,Arnold Schwarzenegger/Austin O'Brien/Charles Dance/Bridget Wilson-Sampras,"6,2",http://www.imdb.com/title/tt0107362/

###
# @name v1FieldsCsv
# Récupère les noms des colonnes du CSV
POST {{host}}/v1/fields/csv HTTP/1.1
Content-Type: text/csv

title,year,director/firstName,director/LastName,actors,rating,imdb
Rocky,1976,John G.,Avildsen,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young,"8,1",http://www.imdb.com/title/tt0075148/
Rocky 2,1979,Sylvester,Stallone,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young/Burgess Meredith/Tony Burton/Frank Stallone/Stu Nahan,"7,2",http://www.imdb.com/title/tt0079817/
Rocky 3,1982,Sylvester,Stallone,Sylvester Stallone/Talia Shire/Carl Weathers/Burt Young/Burgess Meredith/Mister T./Hulk Hogan/Tony Burton,"6,7",http://www.imdb.com/title/tt0084602/
Last Action Hero,1993,John,McTierman,Arnold Schwarzenegger/Austin O'Brien/Charles Dance/Bridget Wilson-Sampras,"6,2",http://www.imdb.com/title/tt0107362/

###
# @name v1TarTei2json
# Convertit un fichier .tar.gz contenant des fichiers TEI en fichier .tar.gz contenant des fichiers JSON
# @extension tar.gz
POST {{host}}/v1/tar-tei2json HTTP/1.1
Content-Type: application/x-tar

< ./example-tei.tar.gz

###
# @name v1TarTei2xml
# Convertit un fichier .tar.gz contenant des fichiers TEI en fichier .tar.gz contenant des fichiers XML simplifiés
# @extension tar.gz
POST {{host}}/v1/tar-tei2xml HTTP/1.1
Content-Type: application/x-tar

< ./example-tei.tar.gz
