rexyai / RestRserve

R web API framework for building high-performance microservices and app backends
https://restrserve.org
275 stars 32 forks source link

[BUG] short bug description #124

Closed mrchypark closed 4 years ago

mrchypark commented 4 years ago

Reporting an Issue

Make use of the Preview tab just above!

Before filing an issue

Please ensure that you:

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Please provide a minimal example. 'minimal' generally means that example should not use any packages except RestRserve. If you are not sure what 'minimal reproducible example' is, please consult here. We appreciate your time to make a bug report.

For example:

app <- Application$new()

app$logger$set_log_level("all")

app$add_post(
  path = "/",
  FUN = function(req, res){
    res$set_body(req$body)
  }
)

backend = BackendRserve$new()
backend$start(app, http_port = 5000, encoding = "utf8")

Expected behavior

A clear and concise description of what you expected to happen.

I just try simple json in, json out.

Environment information

Please provide output of the sessionInfo() command.

For example:

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux bullseye/sid

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.6.2

Additional context

Add any other context about the problem here.

image

request = Request$new(
  path = "/",
  method = "POST",
  body = '{"test":"test"}',
  content_type = "application/json"
)

response = app$process_request(request)
cat(response$body)

when i try process request, return 200. but curl request is not.

image

dselivanov commented 4 years ago
mrchypark commented 4 years ago

I'm sorry to un fit issue. I'll try again after closing this.