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

Unable to upload an image file to the server via HTTP #266

Open
a-khakimov opened this issue May 5, 2024 · 1 comment
Open

Unable to upload an image file to the server via HTTP #266

a-khakimov opened this issue May 5, 2024 · 1 comment
Labels
bug Something isn't working workaround

Comments

@a-khakimov
Copy link

I couldn't figure out how to upload an image file to the server using the HTTP method with Tyrian. I couldn't find any code examples. Help me please to understand how to do this correctly.

Questions:

  • How can I correctly upload an image file to the server using the Tyrian?
  • Are there any limitations or peculiarities with Tyrian when transmitting files? (Currently, I'm concerned because I only saw the possibility of transmitting the following types of request body in the source code: html, json, xml, plainText)
  • If the functionality is not supported, are there plans to add support for file transmission in future versions of Tyrian?

Thank you for your help!

@davesmith00000
Copy link
Member

Hi @a-khakimov, sorry for the slow reply and thank you for the pull request, I shall take a look!

The short answer is that I don't know off the top of my head. It is quite probably an oversight and that you are the first person to try this with Tyrian's HTTP client. If that's the case we should of course fix it, thank you for reporting. 🙏

I feel like @hobnob must have done stuff like this with Tyrian though? Maybe we can summon him by invoking his name... 😄

I don't feel great about having to recommend this, just because we should support images out of the box, but as a work-around you can also use http4s-dom (or any other Cats Effect / ZIO compatible client), which is a more fully featured HTTP Client. There is an example here: https://github.com/PurpleKingdomGames/tyrian/tree/main/examples/http4s-dom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workaround
Projects
None yet
Development

No branches or pull requests

2 participants