rest

Can spring boot controller receive plain/text?

断了今生、忘了曾经 提交于 2021-02-09 11:10:07
问题 I am trying to process a POST request with body of plain text (utf-8) but it seems that spring does not like the plain text nature of the call. Could it be that it is not supported - or otherwise, am I coding it wrong? @RestController @RequestMapping(path = "/abc", method = RequestMethod.POST) public class NlpController { @PostMapping(path= "/def", consumes = "text/plain; charset: utf-8", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> doSomething(@RequestBody

Can spring boot controller receive plain/text?

回眸只為那壹抹淺笑 提交于 2021-02-09 11:09:59
问题 I am trying to process a POST request with body of plain text (utf-8) but it seems that spring does not like the plain text nature of the call. Could it be that it is not supported - or otherwise, am I coding it wrong? @RestController @RequestMapping(path = "/abc", method = RequestMethod.POST) public class NlpController { @PostMapping(path= "/def", consumes = "text/plain; charset: utf-8", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> doSomething(@RequestBody

Can spring boot controller receive plain/text?

独自空忆成欢 提交于 2021-02-09 11:08:49
问题 I am trying to process a POST request with body of plain text (utf-8) but it seems that spring does not like the plain text nature of the call. Could it be that it is not supported - or otherwise, am I coding it wrong? @RestController @RequestMapping(path = "/abc", method = RequestMethod.POST) public class NlpController { @PostMapping(path= "/def", consumes = "text/plain; charset: utf-8", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> doSomething(@RequestBody

Calling a REST API from a trigger or stored procedure in mysql?

半腔热情 提交于 2021-02-09 10:52:54
问题 I want to call rest api in a POST method from a stored procedure or trigger in mysql server on windows. How do I perform this solely with MySQL? 回答1: You can use a mysql-udf-http and then create a trigger like this: delimiter $$ CREATE TRIGGER upd_check BEFORE UPDATE ON account FOR EACH ROW BEGIN IF NEW.amount > 0 THEN set @json = select json_object(account_id,amount) select http_post('http://restservice.example.com/account/post',@json); END IF; END;$$ delimiter; 回答2: Basically you can't. And

Calling a REST API from a trigger or stored procedure in mysql?

我们两清 提交于 2021-02-09 10:48:24
问题 I want to call rest api in a POST method from a stored procedure or trigger in mysql server on windows. How do I perform this solely with MySQL? 回答1: You can use a mysql-udf-http and then create a trigger like this: delimiter $$ CREATE TRIGGER upd_check BEFORE UPDATE ON account FOR EACH ROW BEGIN IF NEW.amount > 0 THEN set @json = select json_object(account_id,amount) select http_post('http://restservice.example.com/account/post',@json); END IF; END;$$ delimiter; 回答2: Basically you can't. And

Calling a REST API from a trigger or stored procedure in mysql?

僤鯓⒐⒋嵵緔 提交于 2021-02-09 10:46:16
问题 I want to call rest api in a POST method from a stored procedure or trigger in mysql server on windows. How do I perform this solely with MySQL? 回答1: You can use a mysql-udf-http and then create a trigger like this: delimiter $$ CREATE TRIGGER upd_check BEFORE UPDATE ON account FOR EACH ROW BEGIN IF NEW.amount > 0 THEN set @json = select json_object(account_id,amount) select http_post('http://restservice.example.com/account/post',@json); END IF; END;$$ delimiter; 回答2: Basically you can't. And

Date format changed in Payara 5 (Long does not work anymore ) — org.eclipse.yasson.YassonProperties#ZERO_TIME_PARSE_DEFAULTING

有些话、适合烂在心里 提交于 2021-02-09 02:45:30
问题 Using Payara 4.174 and receive in backend the date as a long, for example 1540545780000. Now, I upgraded to Payara version 5. public User { String name; Date birthdate; } @POST @Path("/user/) public void createUser(User user) { ... } json call { name: "name", birthdate: 1540545780000 } Now The call brakes with the following error: Caused by: javax.json.bind.JsonbException: Error parsing class java.util.Date from value: 1540545780000. Check your @JsonbDateFormat has all time units for class

Authorization header is not encrypted over HTTPS

谁说胖子不能爱 提交于 2021-02-08 14:11:09
问题 I am currently consuming a REST API which uses HTTP Basic Authentication. Based on the below picture, isn't the Authorization header supposed to be encrypted once I am using an Angular app over an HTTPS connection? 回答1: With HTTPS, the HTTP requests/responses are sent over an SSL/TLS connection. It ensures that the entire message (including the headers) is encrypted when it is sent over the wire . If anyone intercepts the message, they won't be able to read the actual content. However, the

Authorization header is not encrypted over HTTPS

余生颓废 提交于 2021-02-08 14:08:28
问题 I am currently consuming a REST API which uses HTTP Basic Authentication. Based on the below picture, isn't the Authorization header supposed to be encrypted once I am using an Angular app over an HTTPS connection? 回答1: With HTTPS, the HTTP requests/responses are sent over an SSL/TLS connection. It ensures that the entire message (including the headers) is encrypted when it is sent over the wire . If anyone intercepts the message, they won't be able to read the actual content. However, the

How to pass date(dd/MM/yyyy HH:mm) as a parameter in REST API

本小妞迷上赌 提交于 2021-02-08 13:41:36
问题 I am trying to write a rest api in which I am passing date as a URL parameter. Date formate is dd/MM/yyyy HH:mm ; REST API URL Is public static final String GET_TestDate = "/stay/datecheck?dateCheckIn={dateCheckIn}"; and Rest Method is @RequestMapping(value = HotelRestURIConstants.GET_TestDate, method = RequestMethod.GET) public @ResponseBody String getDate(@PathVariable("dateCheckIn") @DateTimeFormat(iso= DateTimeFormat.ISO.DATE) String dateCheckIn) { logger.info("passing date as a param");