Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

cURL Put request not working?

Featured Replies

Hi, I'm trying to do a cURL PUT request using Insert from URL to Discord's API.

I've successfully completed the PUT request using Postman, but I can't get it to work in Filemaker. 

I've successfully completed GET and POST requests with Filemaker, so I know my Discord authorization is working.

Here's the url I'm using (with IDs removed):

"https://discordapp.com/api/channels/<channel_id>/messages/<message_id>/reactions/<:name:id>/@me"

Here are my curl options (with authorization removed):

--request PUT
--header "Authorization: <token>"  
--header "User-Agent: <user>"
--header "Content-Type: application/json" 

 

I'm getting this error response:

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 411 (Length Required)!!1</title>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>411.</b> <ins>That’s an error.</ins>
  <p>POST requests require a <code>Content-length</code> header.  <ins>That’s all we know.</ins>

The last line of the response makes me wonder if Filemaker is submitting it as POST and not PUT?

Any suggestions are appreciated!

Thanks!

I would think that the mention of POST is just an error in their documentation.

As to your headers: you will have to add a Content-length one apparently.

You also don't have to send a User-Agent so you can skip that.

  • Author

Thanks Wim. Adding this solved it:

 --header "Content-Length: 0"

Curiously, I had been able to get the PUT request to work with the Base Elements plugin without a Content-Length header:

BE_HTTP_SetCustomHeader ( "Authorization" ; "<token>" ) & 
BE_HTTP_SetCustomHeader ( "Content-Type" ; "application/json" ) & 
BE_HTTP_PUTData ( "https://discordapp.com/api/channels/<channel_id>/messages/<message_id>/reactions/<emoji>/@me" ; "" )

Thanks for your help!

Pretty sure that the BE plugin adds it automatically, same as Postman does...

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.