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

Refactor streaming api code to a factory or a common function #38835

Open
jsartisan opened this issue Jan 24, 2025 · 0 comments
Open

Refactor streaming api code to a factory or a common function #38835

jsartisan opened this issue Jan 24, 2025 · 0 comments
Assignees
Labels
Anvil Pod Issue related to Anvil project Task A simple Todo

Comments

@jsartisan
Copy link
Contributor

jsartisan commented Jan 24, 2025

Right now, we are using creating streaming request directly using Request and fetch directly like this:

const request = new Request(apiURL, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(requestBody),
  });

  return fetch(request);

We should have a common function that adds all the required headers for streaming and uses them in all places.

@jsartisan jsartisan added the Anvil Pod Issue related to Anvil project label Jan 24, 2025
@Nikhil-Nandagopal Nikhil-Nandagopal added the Task A simple Todo label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Anvil Pod Issue related to Anvil project Task A simple Todo
Projects
None yet
Development

No branches or pull requests

3 participants