# Как отправлять изображения через API?

**URL:** https://meta.discourse.org/t/how-to-post-pictures-via-api/314282
**Category:** Development
**Created:** [29.Июнь.2024 06:49:34 UTC](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282 "2024-06-29T06:49:34Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [02.Июль.2024 22:59:22 UTC](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282/5 "2024-07-02T22:59:22Z")

</div>

> [@maxtim](#):
>
> Я работаю над [плагином](https://github.com/maxtimbo/discourse-sync) для Obsidian и бьюсь головой об стену, пытаясь загрузить изображения.

Я не очень хорошо знаком с этой экосистемой, но, возможно, это поможет?

> [@How to upload images via API with Node.js?](https://meta.discourse.org/t/how-to-upload-images-via-api-with-node-js/172605/2):
>
> I got this to work, like this: import Axios from "axios"; import FormData from "form-data"; import fs from "fs"; const http = Axios.create({ baseURL: "https://forum.zeebe.io", headers: { "Api-Key": "...", "Api-Username": "...", "Content-Type": "application/json", Accept: "application/json", }, }); http.interceptors.request.use((config) =\> { if (config.data instanceof FormData) { Object.assign(config.headers, config.data.getHeaders()); } return config; }); …

---

_[View the full topic](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282)._
