post
-
Spring boot api test codeComputer Science/Spring boot 2022. 10. 6. 14:44
json을 포함하여 body를 받아야하는 post api로 test를 하겠다. test를 진행할 controller 이다. package com.lof.lofserver.controller.user; import com.lof.lofserver.controller.user.request.UserInfoDto; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/v1/user") public class UserController { @PostMapping("/create") public ResponseEntity create..
-
AWS Lambda Node.js 로 api call 하기Computer Science/Aws 2022. 9. 29. 17:06
람다에서 함수를 생성후 post 로 api call 함수를 만들어 봤다. data 까지 추가하여서 진행하는 원본은 아래와 같다. http 80 으로 보내려면 require 의 https 를 http로 변환하면 된다. const https = require('https'); const doPostRequest = () => { const data = { value1: 1, value2: 2, }; return new Promise((resolve, reject) => { const options = { host: 'www.example.com', path: '/post/example/action', method: 'POST', headers: { 'Content-Type': 'application/json..