Java Code Examples for io.micronaut.http.MediaType#APPLICATION_JSON

The following examples show how to use io.micronaut.http.MediaType#APPLICATION_JSON . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SlackAppController.java    From java-slack-sdk with MIT License 4 votes vote down vote up
@Post(value = "/events", consumes = {MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON})
public HttpResponse<String> dispatch(HttpRequest<String> request, @Body String body) throws Exception {
    Request<?> slackRequest = adapter.toSlackRequest(request, body);
    return adapter.toMicronautResponse(slackApp.run(slackRequest));
}
 
Example 2
Source File: JsonRpcController.java    From consensusj with Apache License 2.0 4 votes vote down vote up
@Post(produces = MediaType.APPLICATION_JSON)
public CompletableFuture<JsonRpcResponse<Object>> index(@Body JsonRpcRequest req) {
    log.info("JSON-RPC call: {}", req.getMethod());
    return jsonRpcService.call(req);
}
 
Example 3
Source File: JsonRpcController.java    From consensusj with Apache License 2.0 4 votes vote down vote up
@Post(produces = MediaType.APPLICATION_JSON)
public CompletableFuture<JsonRpcResponse<Object>> index(@Body JsonRpcRequest req) {
    log.debug("JSON-RPC call: {}", req.getMethod());
    return jsonRpcService.call(req);
}