| POST | /upload | Tải file |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
/**
* Upload file
*/
public static class FileUpload extends FileUploadRequest implements IPost
{
}
public static class FileUploadRequest
{
public IHttpFile fileUpload = null;
public AccessType accessType = null;
public StorageStatus storageStatus = null;
public IHttpFile getFileUpload() { return fileUpload; }
public FileUploadRequest setFileUpload(IHttpFile value) { this.fileUpload = value; return this; }
public AccessType getAccessType() { return accessType; }
public FileUploadRequest setAccessType(AccessType value) { this.accessType = value; return this; }
public StorageStatus getStorageStatus() { return storageStatus; }
public FileUploadRequest setStorageStatus(StorageStatus value) { this.storageStatus = value; return this; }
}
public static interface IHttpFile
{
public String name = null;
public String fileName = null;
public Long contentLength = null;
public String contentType = null;
public InputStream inputStream = null;
}
public static enum AccessType
{
Public,
Restricted;
}
public static enum StorageStatus
{
Draft,
Permanent,
Archive;
}
public static interface IResponseRequest
{
public Integer code = null;
public String message = null;
}
}
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.