dgate | an API Gateway based on Vert.x | REST library
kandi X-RAY | dgate Summary
kandi X-RAY | dgate Summary
an API Gateway based on Vert.x
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dgate
dgate Key Features
dgate Examples and Code Snippets
Community Discussions
Trending Discussions on dgate
QUESTION
I have a winCGI executable script returning a image. I am using Intraweb as server.
I have a custom web server made in delphi and I create a function to run the cgi and return the image.
The cgi is from a third party and I can't change your code. I have the next code returning from CGI when I query a image:
...ANSWER
Answered 2019-Oct-09 at 13:39Your CGI module generates raw HTTP response that should be transmitted as-is by your IW content handler. The response message consists of:
- Status line
- HTTP header lines
- An empty line separating headers and body
- Body (actual image data in your case)
IntraWeb's THTTPReply
doesn't seem to give you control over raw HTTP response. It provides dedicated interface to separately manipulate with status, headers and body. That's why you need to pre-process the stream returned from CGI and split headers apart from body by the empty line. Then you can transmit them via THTTPReply
. Maybe you'd also like to whitelist only some headers and ignore the rest.
In your code snippet you use ReadStringFromStream
which is pointless, because you discard the returned value anyway. It moves the position of Stream
to the end of the stream, but that doesn't matter, because aReply.SendStream(Stream)
sends the whole stream content from the beginning.
Another point is that you use IndyTextEncoding_OSDefault
as the last parameter to ReadStringFromStream
, which is probably wrong, because HTTP header is encoded in ASCII and therefore you should use IndyTextEncoding_ASCII
.
Try this code instead:
QUESTION
I have a rich text box in my main for that I want to write stuff to from different threads. I have tried to do this using invoking, but I can't seem to get it to work. If I try it with:
...ANSWER
Answered 2017-Dec-09 at 02:23You can define a Sub globally on your class as the following:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dgate
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page