AWS Examples

<back to all web services

Files

The following routes are available for this service:
All Verbs/restfiles/files
All Verbs/restfiles/files/{Path*}
Files Parameters:
NameParameterData TypeRequiredDescription
PathpathstringNo
TextContentsquerystringNo
ForDownloadqueryboolNo
FilesResponse Parameters:
NameParameterData TypeRequiredDescription
DirectoryformFolderResultNo
FileformFileResultNo
ResponseStatusformResponseStatusNo
FolderResult Parameters:
NameParameterData TypeRequiredDescription
FoldersformList<Folder>No
FilesformList<File>No
Folder Parameters:
NameParameterData TypeRequiredDescription
NameformstringNo
ModifiedDateformDateTimeNo
FileCountformintNo
File Parameters:
NameParameterData TypeRequiredDescription
NameformstringNo
ExtensionformstringNo
FileSizeBytesformlongNo
ModifiedDateformDateTimeNo
IsTextFileformboolNo
FileResult Parameters:
NameParameterData TypeRequiredDescription
NameformstringNo
ExtensionformstringNo
FileSizeBytesformlongNo
ModifiedDateformDateTimeNo
IsTextFileformboolNo
ContentsformstringNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/reply/Files HTTP/1.1 
Host: awsapps.servicestack.net 
Content-Type: text/jsv
Content-Length: length

{
	path: String,
	textContents: String,
	forDownload: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	directory: 
	{
		folders: 
		[
			{
				name: String,
				modifiedDate: 0001-01-01,
				fileCount: 0
			}
		],
		files: 
		[
			{
				name: String,
				extension: String,
				fileSizeBytes: 0,
				modifiedDate: 0001-01-01,
				isTextFile: False
			}
		]
	},
	file: 
	{
		name: String,
		extension: String,
		fileSizeBytes: 0,
		modifiedDate: 0001-01-01,
		isTextFile: False,
		contents: String
	},
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}