namespace MyApp.ServiceModel
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
type FileAccessType =
| Public = 0
| Team = 1
| Private = 2
[<AllowNullLiteral>]
type FileSystemFile() =
member val Id:Int32 = new Int32() with get,set
member val FileName:String = null with get,set
member val FilePath:String = null with get,set
member val ContentType:String = null with get,set
member val ContentLength:Int64 = new Int64() with get,set
[<References(typeof<FileSystemItem>)>]
member val FileSystemItemId:Int32 = new Int32() with get,set
[<AllowNullLiteral>]
type FileSystemItem() =
member val Id:Int32 = new Int32() with get,set
member val FileAccessType:Nullable<FileAccessType> = new Nullable<FileAccessType>() with get,set
member val File:FileSystemFile = null with get,set
member val AppUserId:String = null with get,set
[<AllowNullLiteral>]
type CreateFileSystemItem() =
member val FileAccessType:Nullable<FileAccessType> = new Nullable<FileAccessType>() with get,set
member val File:FileSystemFile = null with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /csv/reply/CreateFileSystemItem HTTP/1.1
Host: blazor-gallery.servicestack.net
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"fileAccessType":"Public","file":{"id":0,"fileName":"String","filePath":"String","contentType":"String","contentLength":0,"fileSystemItemId":0}}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"id":0,"fileAccessType":"Public","file":{"id":0,"fileName":"String","filePath":"String","contentType":"String","contentLength":0,"fileSystemItemId":0},"appUserId":"String"}