Questions tagged [webmachine]

WebMachine is an Erlang framework for creating RESTful Web Services using Erlang/OTP best practices.

Webmachine is an application layer that adds HTTP semantic awareness on top of the excellent bit-pushing and HTTP syntax-management provided by mochiweb, and provides a simple and clean way to connect that to your application's behavior.

A Webmachine application is a set of resources, each of which is a set of functions over the state of the resource. We really mean functions here, not object-methods, infinite-server-loops, or any other such construction. This aspect of Webmachine is one of the reasons why Webmachine applications are relatively easy to understand and extend.

These functions give you a place to define the representations and other Web-relevant properties of your application's resources -- with the emphasis that the first-class things on the Web are resources and that their essential properties of interaction are already quite well defined and usefully constrained.

For most Webmachine applications, most of the functions are quite small and isolated. One of the nice effects of this is that a quick reading of a resource will give you an understanding of the application, its Web behavior, and the relationship between them. Since these functions are usually referentially transparent, Webmachine applications can be quite easy to test. There's no need for mock objects, fake database connections, or any other wastes of time when you can write tests against each component of your application in terms of the input and output to various functions.

We believe that by giving Web developers a system with conventions that directly map to HTTP and REST, we help them to write and extend Web applications quickly while not dictating the shape of the rest of their application. The resulting applications are straightforward to examine and maintain, and have very easily understood HTTP semantics. It is also available for ruby as webmachine-ruby

36 questions
0
votes
0 answers

How to read peer's port number in webmachine resource?

Inside a Webmachine resource Peer's IP address shall be obtained using PeerIP = wrq:peer(ReqData). function in ReqData API. Is there any method to get peer's port number in a Webmachine resource ?
Anish
  • 1,490
  • 1
  • 13
  • 13
0
votes
1 answer

webmachine access post body in *_perf_logger

Attempting to intercept all the requests on webmachine API. I took a copy of webmachine_perf_logger.erl and changed to publish the {verb, resource, module}. For the posts I'm also interested in BODY. Because the logging part in…
user2624443
  • 60
  • 1
  • 6
0
votes
1 answer

How to integrate Chicago Boss and Webmachine ?

I just want to develop a RESTful api server with webmachine, but i want to use chicago boss's tools in the same time , Does anyone can help me ?
Michael
  • 367
  • 5
  • 12
0
votes
1 answer

Why does my successful streaming response in Webmachine have the status code 500?

The following code is the full source of a webmachine resource. The expected behaviour is that the streaming response should be a 200, and should be a string of specified length, entirely composed of the letter 'a'. This string is indeed returned…
Chris Hagan
  • 2,437
  • 3
  • 17
  • 16
0
votes
1 answer

Works alone but not after I release it with rebar

A simple application based on Webmachine and ErlyDtl when I start it with ./start it works. If I try to do a release with rebar then it starts but when I exeute a request then it will fail with following error. I've tried to include the compiler…
ruslander
  • 3,815
  • 4
  • 32
  • 34
0
votes
1 answer

Webmachine app keeps restarting

I've got a webmachine project that also has a process running in the background that performs a task and stores the data in an ETS table. When I don't make a request to the application for about an hour, the request takes a long time and the data in…
Nick
  • 1,845
  • 3
  • 15
  • 22
1 2
3