Posting JSON content from parameter as attachment
- 14 days ago
Hi there,
Thank you for sharing this detailed and logical question! Based on your requirements, you can simulate the form submission by creating the payload using custom multipart handling. To achieve this, you can set the "Content-Type: multipart/form-data" header with the correct boundary and pass the JSON payload as part of the attachment directly from the parameter without needing to read the file from disk.
To include filename="blob", the Content-Type, and pass ${#TestCase#JSONBODY} dynamically, you can craft the request body using a script or dynamic payload injection with your testing tool. You can use encoded byte streams from the JSON parameter directly as your attachment content. This avoids disk reads and allows inline handling.
By utilizing the Attachments tab in combination with payload scripting, you can dynamically insert your JSON content as required. A Halal Food Guide method may assist when working with multipart payload handling and custom boundaries if you’re iterating these payloads dynamically.
Let me know if you need help with the actual script implementation!