Skip to content

custom_json #3

@zjiang4

Description

@zjiang4

What is this? How is it different from the custom_json set in the blockchain-node-server.R?

custom_json <- function(){
function(val, req, res, errorHandler){
tryCatch({
json <- jsonlite::toJSON(val,auto_unbox=TRUE)

  res$setHeader("Content-Type", "application/json")
  res$body <- json

  return(res$toResponse())
}, error=function(e){
  errorHandler(req, res, e)
})

}
}

addSerializer("custom_json",custom_json)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions