sdelements / lets-chat

Self-hosted chat app for small teams
http://sdelements.github.io/lets-chat
MIT License
9.77k stars 1.58k forks source link

Api for file upload - Xamarin integration #626

Open softsan opened 8 years ago

softsan commented 8 years ago

Hi, I want to integrate lets chat in Xamarin.forms application. so i am thinking to go through REST API, But i didnt find any method for uploading a file using REST API in documentation.

So can you please guide me how to do that?

Thanks.

hhaidar commented 8 years ago

There are two paths available:

Here's an example via curl:

curl http://localhost:5000/rooms/**SOMEROOMID**/files --header "authorization: Bearer **TOKENGOESHERE**" -F 'file=@**/path/to/wow.jpg**'
hhaidar commented 8 years ago

There's also a parameter called post, which if set to true should also past a url link of the file in chat.

vwbusguy commented 8 years ago

Shouldn't this be a POST call?