Comments (8)
Unfortunately I cannot predict everything and to be fair the httpbeast readme is indeed very barebones.
But sure, I'll add this particular tip to the readme.
from httpbeast.
Not much more to it than this: https://github.com/dom96/httpbeast/blob/master/tests/helloworld.nim
from httpbeast.
Ok, seems easy. It will only be complicated to handle both asynchttpserver and httpbeast since the Request
objects are pretty different, but I hope to be able to implement some compatible api.
Just one doubt: I see
proc send*(req: Request, code: HttpCode, body: string, headers="") =
## Responds with the specified HttpCode and body.
##
## **Warning:** This can only be called once in the OnRequest callback.
For chunked responses I can use unsafeSend
, right?
from httpbeast.
Documentation would be nice (aka make it actually useful). How do you do POST requests?...
from httpbeast.
https://github.com/dom96/httpbeast/blob/master/tests/dispatcher.nim#L16
The best documentation sometimes is tests :)
from httpbeast.
How do I set headers/cookies then, that doesn't seem to be in the tests. I think most people who didn't code the whole thing themselves think actual documentation is always the best documentation...
from httpbeast.
Sure, but I'd say you shouldn't be afraid to look into the code, especially for something as low-level as httpbeast. Maybe you'd be better off using Jester?
from httpbeast.
So yesterday I also figured out how to use headers and set cookies, by reading the code as you say. But then I ran into not being able to serve static binary files and I went to Jester as you also say. I understand that you do all this for free and I have no right to complain, but you have knowledge that you can probably hash out in 10 minutes that would have saved me and many others in the future 2 hours of figuring things out.
I want to build a real website (with sessions/cookies/static files/post requests) and the way I came to this project was through a list of names all unknown to me. This project stood out for being fast, so it was the first one I tried. Had I known this was more specific I would have gone to Jester. Just 1 sentence about "This is for X, if you want something general I suggest you check out Jester" could have saved me 2 hours
from httpbeast.
Related Issues (20)
- Unsanitized headers can break body in response HOT 2
- Inconsistent behavior on run() HOT 4
- Do some profiling HOT 5
- A way to kill HTTP beast? HOT 2
- hook to enable body to be streamed HOT 1
- Errors with hot code reloading HOT 1
- httpbeast-0.4.1/httpbeast.nim(373, 17) Error: undeclared identifier: 'addTimer' HOT 3
- Fix server crashing when receiving POST multipart-formdata request with a body that contains a value of "PUT", "POST", "GET" etc. #13
- Too many new line between response header and body. HOT 1
- Random segmentation fault when using orc and threads more than 1 HOT 5
- set[int32] used that depends on odd compiler behavior
- Using await in handlers appears to have a substantial performance penalty HOT 7
- bump the 0.4.2 version HOT 1
- Not as Fast as Java/Vertx - Configurable buffer sizss?
- Allow to change port for tests HOT 1
- SIGSEGV when running a basic jester 0.6.0 server in nim 2.0 on M1 Mac HOT 3
- Request: Make Github tag for version 0.4.2 HOT 3
- Regarding static directory
- Rumors HOT 1
- http 1.1 request smuggling HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpbeast.