Webhook API ignores files attached in a POST request

(#436) Bug Awaiting confirmation api

Summary

While experimenting with the Fluxer webhook API I encountered what I believe to be a bug. I've been trying to send a message through a webhook where there is a file attached alongside the message. I haven't been able to find clear documentation on the expected headers Fluxer's webhook API wants, but my understanding is that the Fluxer webhook API closely mirrors that of the Discord webhook API (and that seems to work for almost everything). The Fluxer API still response with HTTP 200 (or 204) and indicates zero problems, yet the message that actually gets sent doesn't have any attachments on it.

Steps to reproduce

  1. Create a webhook within a channel
  2. Send a POST request with a file to attach to the webhook URL
  3. Observe the sent message with a lack of attachment AND the lack of error code
Here is my example code to reproduce the problem using Python (assuming a small test.txt file is already created):
# Python 3.xx
import requests, json

URL = "https://api.fluxer.app/webhooks/{id}/{token}?wait=true"

with open("test.txt", "rb") as file:
	files = {
		"payload_json": (None, json.dumps({"content": "Body Message"})),
		"file": ("test.txt", file)
	}
	response = requests.post(URL, files=files)
	print(response.status_code) # -> 200
	print(response.json()) # -> "attachments" is empty
This code works exactly as expected when using a Discord webhook URL, but when used with Fluxer there is no file attached to the message.

Logs or screenshots (optional)

image image
  • 566614497-d475010e-6700-4aad-8919-1a4a4ada548f.png

    566614497-d475010e-6700-4aad-8919-1a4a4ada548f.png

    548×185 | 15 kB

  • 566615326-8d09eef9-3228-49af-aa0e-276c137d314f.png

    566615326-8d09eef9-3228-49af-aa0e-276c137d314f.png

    456×455 | 26 kB

4 comments

Sign in with Fluxer to comment and vote.
Comment by Rex
RexSystem 1 vote
Status changed from Fixed to Awaiting confirmation
This was closed in a bulk cleanup before Fluxer V2 without being checked or fixed. It may work now, so it is waiting for someone to confirm whether the bug still happens.
Comment by tempest:squll.fartcore.ai
tempest:squll.fartcore.ai 1 vote originally by @HellishBro on GitHub
it does work. theres some community bot libraries that allows webhook and files. you might be able to look at their source codes to figure out what went wrong
Comment by @Kenneract
RexSystem 1 vote originally by @Kenneract on GitHub OP
it does work. theres some community bot libraries that allows webhook and files. you might be able to look at their source codes to figure out what went wrong
Would you be able to link one of the bot libraries you're talking about? I'd love to take a look and see where my issue is
Comment by tempest:squll.fartcore.ai
tempest:squll.fartcore.ai 1 vote originally by @HellishBro on GitHub
try fluxer.py
> it does work. theres some community bot libraries that allows webhook and files. you might be able to look at their source codes to figure out what went wrong Would you be able to link one of the bot libraries you're talking about? I'd love to take a look and see where my issue is