# Using JuliaWebAPI.jl for simple REST API

**URL:** <https://discourse.julialang.org/t/using-juliawebapi-jl-for-simple-rest-api/38008>\
**Category:** General Usage\
**Created:** [April 22, 2020, 4:45am UTC](https://discourse.julialang.org/t/using-juliawebapi-jl-for-simple-rest-api/38008 "2020-04-22T04:45:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [April 22, 2020, 4:45am UTC](https://discourse.julialang.org/t/using-juliawebapi-jl-for-simple-rest-api/38008/1 "2020-04-22T04:45:42Z")

</div>

I want to expose a function on a remote server that processes some data and returns a CSV file to a non-Julia client. Performance isn’t critical, so I thought a simple HTTP interface would work well.

From the description of JuliaWebAPI.jl, it seems appropriate, but all of the examples invovle running a ZMQ “backend” along with a HTTP server. I can’t find a way to just call functions directly via a HTTP request without using ZMQ. Is it possible?

EDIT:  
Never mind. HTTP.jl is higher level than I realized and easy to use for this case. I just followed this example:

> [@Starting a simple web server using HTTP.jl](https://discourse.julialang.org/t/starting-a-simple-web-server-using-http-jl/38012/2):
>
> Check the information about HTTP.Handers or the [web doc of the package](https://juliaweb.github.io/HTTP.jl/stable/public_interface/#Server-/-Handlers-1), that it has a lot of examples. I put you an simple example that is working in my computer: const ROUTER = HTTP.Router() HTTP.@register(ROUTER, "GET", "/\*", req-\>HTTP.Response(200, "Hi")) # You can register more HTTP.@register(ROUTER, "GET", "/bye", req-\>HTTP.Response(200, "Bye!")) HTTP.serve(ROUTER, Sockets.localhost, 8081) I hope it could help you.
