| POST | /upload | Tải file |
|---|
namespace tvpl.api.ServiceModel
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type IResponseRequest =
abstract Code:Int32 with get,set
abstract Message:String with get,set
[<AllowNullLiteral>]
type IHttpFile =
abstract Name:String with get,set
abstract FileName:String with get,set
abstract ContentLength:Int64 with get,set
abstract ContentType:String with get,set
abstract InputStream:Stream with get,set
type AccessType =
| Public = 0
| Restricted = 1
type StorageStatus =
| Draft = 0
| Permanent = 1
| Archive = 2
[<AllowNullLiteral>]
type FileUploadRequest() =
member val FileUpload:IHttpFile = null with get,set
member val AccessType:AccessType = new AccessType() with get,set
member val StorageStatus:StorageStatus = new StorageStatus() with get,set
///<summary>
///Upload file
///</summary>
[<AllowNullLiteral>]
type FileUpload() =
inherit FileUploadRequest()
interface IPost
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 /upload HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"fileUpload":null,"accessType":"Public","storageStatus":"Draft"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{Unable to show example output for type 'IResponseRequest' using the custom 'csv' filter}Cannot dynamically create an instance of type 'tvpl.api.ServiceModel.IResponseRequest'. Reason: Cannot create an instance of an interface.