Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

How to correctly format multipart/form-data request body for HTTP session

Solved1.90K views29th August 2023HTPP Multipart/from-data
0
Julian Yepe [SLC] [DevOps Advocate]227 15th August 2023 0 Comments

I am trying to send a POST HTTP request with Content-Type=multipart/form-data and I keep getting this error response: (status code: HTTP/1.1 400 Bad Request), returned VT_BSTR : {“errors”: [{“message”: “Multipart Request should be correctly formatted (1=name, 2=key)”}]}.

I have added screenshots from what the request payload and request headers look like when ran from swagger editor, screenshot of the HTTP session i have defined in the protocol.xml, and a screenshot of the of the request being logged by the element. Does anyone know what the issue could be?

Julian Yepe [SLC] [DevOps Advocate] Selected answer as best 29th August 2023

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
1
Floris Cockaerts [SLC] [DevOps Advocate]2.43K Posted 16th August 2023 1 Comment

Hi Julian,

I believe the boundary in your body is wrong. Comparing with this page: Multipart Requests (swagger.io) you can see that the boundary is prefixed with two dashes every time it is used, and suffixed with another two dashes at the end.

Counting the dashes in your header definition, there seem to be 29, and your body contains 29 rather than 31 dashes.
I made a protocol for a similar question here: https://github.com/FlorisCO/Dojo-HttpPostCsv/blob/RC/protocol.xml

Julian Yepe [SLC] [DevOps Advocate] Selected answer as best 29th August 2023
Julian Yepe [SLC] [DevOps Advocate] commented 25th August 2023

Hi Floris,

Changing the dashes to two worked. Thank you for your help.

1
Simon Vandamme [SLC] [DevOps Advocate]952 Posted 16th August 2023 0 Comments

Hi Julian,

As an extra side note, you should let DataMiner add and calculate the Content-Length header instead of hard-coding it in the connector.

Simon Vandamme [SLC] [DevOps Advocate] Answered question 16th August 2023
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs