Skip to main content
Solved

Content-type multipart/form-data returns error

  • August 4, 2025
  • 2 replies
  • 118 views

s5der_clothing
Forum|alt.badge.img+1

I ran into internal error 500 when trying to use attachments. Even If I don’t use attachments and just Content-type multipart/form-data it returns error anyway.

postman
postman
with code (wordpress)

[headers] => WpOrg\Requests\Utility\CaseInsensitiveDictionary Object
        (
            [data:protected] => Array
                (
                    [date] => Sun, 03 Aug 2025 06:23:15 GMT
                    [content-type] => application/json; charset=utf-8
                    [content-length] => 52
                    [x-ratelimit-limit] => 100
                    [x-ratelimit-remaining] => 98
                    [x-ratelimit-reset] => 1754202213.637
                    [vary] => Accept
                    [etag] => W/"34-zWc8gW+EWeg2mrqPaNjNywdzhTk"
                    [x-front-time] => 33
                )

        )

    [body] => {"_error":{"message":"An internal error occurred."}}

Best answer by s5der_clothing

it was all about wp_remote_post, with curl and CURLFile it works well

2 replies

s5der_clothing
Forum|alt.badge.img+1

Another observation. When disable Content-Type in Postman it works

But when disable in  code I see now error [body] => {"_error":{"status":400,"title":"Bad request","message":"Body did not satisfy requirements","details":["body.body: missing"]}}

 


s5der_clothing
Forum|alt.badge.img+1
  • Author
  • Helper
  • Answer
  • August 5, 2025

it was all about wp_remote_post, with curl and CURLFile it works well