Comments (13)
Hello @Al-Muhandis . I'm not sure about you are using in the client-side, but it seems you just need to inform the content-type. For example, if you are using fphttpclient (FPC) or NetHTTPClient (Delphi), just:
YourClient.ContentType := 'application/json';
from brookframework.
Additional info (that will be documented soon):
ARequest.IsPost
= check if the HTTP method isPOST
,PUT
,DELETE
orOPTIONS
.ARequest.IsUploading
= check if the client is sending data (HTML fields, payload data or uploaded files etc.) to the server.
from brookframework.
Hello @Al-Muhandis . I'm not sure about you are using in the client-side, but it seems you just need to inform the content-type. For example, if you are using fphttpclient (FPC) or NetHTTPClient (Delphi), just:
YourClient.ContentType := 'application/json';
- Thank you, but I can not access the client, as it is a telegram server, and my webhook on my server, which listens to POST requests from the telegram API
- Yes, and the content type of the request it put up correctly. It is application/json. I had just checked.
from brookframework.
Additional info (that will be documented soon):
* `ARequest.IsPost` = check if the HTTP method is `POST`, `PUT`, `DELETE` or `OPTIONS`. * `ARequest.IsUploading` = check if the client is sending data (HTML fields, payload data or uploaded files etc.) to the server.
The procedure I have is performed inside the POST
method, so it is unlikely there will be another. But in any case, I don't know where is a ARequest
? There is a property HTTPRequest
in TBrookAction
, and HTTPRequest
which does not contain these functions
from brookframework.
Could you test it outside the webhook using curl --header "Content-Type: application/json" --request POST --data '{"abc":123}' -w "\n" http://your-host:<your-port>
? Just to check if the problem is related to Brook or the environment.
from brookframework.
The procedure I have is performed inside the POST method, so it is unlikely there will be another.
Good news: you can use any HTTP method in the Tardigrade broker. :-)
But in any case, I don't know where is a ARequest?
They are available in the request object of Brook 5+, however, in legacy apps, you can debug to check if IsPost
is returning True
here.
I've tested all features before releasing v4.0.0, but I'll retest them again tonight.
from brookframework.
Could you test it outside the webhook using
curl --header "Content-Type: application/json" --request POST --data '{"abc":123}' -w "\n" http://your-host:<your-port>
? Just to check if the problem is related to Brook or the environment.
The same... Empty POST data in the request
from brookframework.
Confirmed. I'm going to check it tonight and provide a patch fixing the problem. Thanks for reporting!
from brookframework.
@Al-Muhandis , could you try this attached experimental patch? To apply it, download Brook here, the patch 0001 and 0002, so:
git apply 0001-Removes-redundant-configuration.patch
git apply 0002-Fix-issue-161-high-CPU-activity-in-Tardigrade-based-.patch
git apply 0003-Fix-issue-163-reported-by-Al-Muhandis.patch.txt
and rebuild your application again to test if it works.
It is experimental, but should work well.
0003-Fix-issue-163-reported-by-Al-Muhandis.patch.txt
from brookframework.
@Al-Muhandis , could you try this attached experimental patch? To apply it, download Brook here, the patch 0001 and 0002, so:
git apply 0001-Removes-redundant-configuration.patch git apply 0002-Fix-issue-161-high-CPU-activity-in-Tardigrade-based-.patch git apply 0003-Fix-issue-163-reported-by-Al-Muhandis.patch.txtand rebuild your application again to test if it works.
It is experimental, but should work well.
Thank You very much! I applied the 2nd patch even earlier. 3rd patch just now. Now everything works!
from brookframework.
So now I can clarify that telegram plugin does not work with tardigrade broker without 3 patch for BF 4.0
from brookframework.
Indeed. Tonight I'm going to do some tests and move this patch to here. :-)
from brookframework.
Tonight I'm going to do some tests and move this patch to here.
Done! Thanks @Al-Muhandis ! 😃
from brookframework.
Related Issues (20)
- Why plugins projects on github to brookframework is closing? HOT 4
- Telegram plugin for brookframework HOT 15
- i18n HOT 4
- Version 4 ? HOT 14
- libbrook.pas in Source HOT 3
- tardigrade demos throwing errors in libbrook HOT 4
- Server requirements? HOT 4
- dopf & LastInsertID HOT 4
- httprouter.lpr throwing error HOT 2
- How am I supposed to free worker thread in brook daemon? HOT 9
- Use legacy application with tardigrade HOT 19
- CPU Activity is high for tardigrade projects BROOK4 HOT 4
- More documentation HOT 1
- Brookframework with sagui (legacy) HOT 11
- HTTP Client HOT 1
- Where did the captcha plugin for 4.0 go? HOT 1
- Some suggestion about JTemplate? HOT 3
- [IDEA] New repository HOT 1
- EBrookHTTPServer: Failed to send data in request for HOT 2
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 brookframework.