Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for Http Plugin. #1311

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

st0le
Copy link

@st0le st0le commented Aug 6, 2022

Adding a new type of JsonRPCPlugin that retrieves results from an API endpoint that can talk the same protocol.

Not completely done. Want to configure the Http methods, etc. but wondering if this will be accepted.

@taooceros
Copy link
Member

Would you please share a sample plugin? I couldn't see how exactly it will be.

protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default)
{
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Post, url);
requestMessage.Content = new StringContent(rpcRequest.ToString(), Encoding.UTF8);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have trouble mostly with this part. It only directly use the rpcRequest as payload, which is mostly flow's style. Therefore, the use case can only be a customized http server.
I would like to see a http plugin not only provide the endpoints address, but also translate flow's query to the specific payload (a parser), and translate the response back to flow's standard response.

@jjw24 jjw24 marked this pull request as draft August 11, 2022 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants