API
-
[ASP.Net Core API] File Upload API / 파일 업로드 APIMicrosoft .NET/ASP.Net & ASP.Net Core 2021. 2. 3. 11:23
파일 저장 경로, 저장 파일 명, 파일을 필수값으로 받아서 서버에 저장하는 API API that receives file storage path, save file name, and file as required values and saves them to the server #region Upload /// /// 파일 업로드 /// /// 파일 저장 경로(서버) /// 파일 저장 이름(서버) /// 파일(클라이언트) /// //[EnableCors("CORS")] [HttpPost("upload")] public string Upload( [Required][FromForm(Name = "path")]string path, [Required][FromForm(Name = "filename")]str..
-
[ASP.Net Core API] API 주소 설정Microsoft .NET/ASP.Net & ASP.Net Core 2020. 9. 17. 22:29
Controller 주소 및 API 주소 일괄 설정 - Controller Class 상단에 표기 ControllerClass 명칭 과 API함수 명칭을 자동으로 주소로 사용 : [Route("[controller]/[action]")] Ex) sample/member 더보기 [Route("[controller]/[action]")] [ApiController] public class sampleController : ControllerBase { //// GET: sample/member [HttpGet] public string member() { return "Virtualgiraffe"; } } Controller 주소 설정 - Controller Class 상단에 표기 Controller Cla..
-
[ASP.Net Core API] REST API와 RESTful 및 CRUD개념Microsoft .NET/ASP.Net & ASP.Net Core 2020. 9. 16. 17:28
RESTful이란? 'REST API'를 제공하는 서비스를 'RESTful'한 API라고 말할 수 있으며, REST 규칙을 따르는 서비스를 'RESTful'이라 칭한다. CRUD란? Create, Read, Update, Delete 4개의 기능을 칭하는 용어다. 이름 SQL 조작 METHOD Create INSERT 생성 POST Read SELECT 읽기 GET Update UPDATE 갱신 PUT Delete DELETE 삭제 DELETE REST API REpresentational State Transfer API 나타낸 + 상태 + 전달 = 전달 상태를 나타낸 API REST API는 API의 전달 규칙을 칭한다. REST API 구성 자원(resource) - URI 행위(verb) - ME..