Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2E4D1200C2C for ; Fri, 3 Mar 2017 20:08:44 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2CDC6160B6D; Fri, 3 Mar 2017 19:08:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 79906160B5E for ; Fri, 3 Mar 2017 20:08:43 +0100 (CET) Received: (qmail 8370 invoked by uid 500); 3 Mar 2017 19:08:42 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Received: (qmail 8358 invoked by uid 99); 3 Mar 2017 19:08:42 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Mar 2017 19:08:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 05B2A18C37F for ; Fri, 3 Mar 2017 19:08:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.679 X-Spam-Level: * X-Spam-Status: No, score=1.679 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id hLfyZ1OY9n7I for ; Fri, 3 Mar 2017 19:08:40 +0000 (UTC) Received: from mail-qk0-f174.google.com (mail-qk0-f174.google.com [209.85.220.174]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 693035FBC1 for ; Fri, 3 Mar 2017 19:08:40 +0000 (UTC) Received: by mail-qk0-f174.google.com with SMTP id n127so191719556qkf.0 for ; Fri, 03 Mar 2017 11:08:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=g0TbMs2DCCmcW3SASwRNzsmR3EU6hjQD/h1lIww2wDg=; b=apabv0Z2fFGza5yNybmz/vn43leoJb0A/Bmoleeu1HT8vZpnfxfnrRy31oum+ZOTbd B745GUi0H0R4C2Z1OrDz0Nqe8AJD0OX82ji2riL5Oua4i/j2wFiJJzfP7vOXbYmkDy+X o12hwxAvn1XS3LmQXt2/WNJyANO5b63R+hROBVq+MKOLxSRfOCUKXktRiaRSL8NShK5X zBWATkVVNPcWJh3TYG7b/IuQpoBwv0BCJcjoVhvJOadW/Y2w8IBUi7pRoOhLBbN5t1qe F0WR6VFSVzF9HjHoSyYNlZ1ibtteKXNVGiaLS6l7st/0ZJlAa1RIzk3NIpPcJJ2MILMU ZuwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=g0TbMs2DCCmcW3SASwRNzsmR3EU6hjQD/h1lIww2wDg=; b=ZxqOlUI5RwRmaEikP9/Ssh8usoNg5D1Rhd+p5E9ADRYJRERoUV+nTjTmhFnu7RcTFm 8tVhDnmbA95w+/m7ZjPV2tU/3aJfJ7Ij8cXMiZO/2uLFVkYd61DkrkIlerPdn5A6cshJ Ifgx1Bz/IcFq5zYREhV9D76Ad/Qc0ZwDPZb0U4RWqURPC3av05IwmChuCR6thFXK3yp+ ALbb9kQrfrfN7o8+pVe+wf50bwo9y6ToM7zEFIAvGeZTNEeBW9/tp7zSiuGbADMDyPmc L8htFqwnIZ4jeTEQ4r2K0Vyja2VZopIzfgLB87hJYO6eccuT8qWP/tLfcuaWqVnFSq96 Q+kQ== X-Gm-Message-State: AMke39nb0f0GM/k2Dl0tABG+PCoz24OdTmim3p99FhmyHFAUm7/RdaJxtIIkwGMPoP0JHnJjLPaqw0Wvtg8XZw== X-Received: by 10.200.54.247 with SMTP id b52mr4322993qtc.160.1488568119802; Fri, 03 Mar 2017 11:08:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.138.136 with HTTP; Fri, 3 Mar 2017 11:08:39 -0800 (PST) In-Reply-To: References: From: Philippe Mouawad Date: Fri, 3 Mar 2017 20:08:39 +0100 Message-ID: Subject: Re: MultiPart/form-data : Supporting JSON body + file upload To: "dev@jmeter.apache.org" Content-Type: multipart/alternative; boundary=001a113e43ca017f290549d846f4 archived-at: Fri, 03 Mar 2017 19:08:44 -0000 --001a113e43ca017f290549d846f4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, Any idea on this one ? Thanks On Wed, Mar 1, 2017 at 10:36 PM, Philippe Mouawad < philippe.mouawad@gmail.com> wrote: > Hello, > Recent JS libraries (Angular + ng-file-upload for example) allow posting = a > request with: > - Parameters that contains JSON > - 1 or more files > > See: > https://github.com/danialfarid/ng-file-upload#upload-service > > {file: file, info: Upload.jsonBlob({id: id, name: name, ...})} send field= s as json blob, 'application/json' content_type > > POST /demo/model HTTP/1.1 > Connection: keep-alive > Accept-Language: en-US,en;q=3D0.5 > Cache-Control: no-cache > Accept-Encoding: gzip, deflate > Pragma: no-cache > User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/201001= 01 Firefox/51.0 > Accept: application/json, text/plain, */* > Content-Length: 9145 > Content-Type: multipart/form-data; boundary=3DcP4hM4kXJ134rNoUFiCCjcKhk4u= zVlZAnFYBdQ; charset=3DUTF-8 > Host: localhost:8081 > > --cP4hM4kXJ134rNoUFiCCjcKhk4uzVlZAnFYBdQ > Content-Disposition: form-data; name=3D"file"; filename=3D"jmeter.png" > Content-Type: image/png > > =E2=80=B0PNG > binary data here ....... > > --cP4hM4kXJ134rNoUFiCCjcKhk4uzVlZAnFYBdQ > Content-Disposition: form-data; name=3D"info"; filename=3D"dem_modele.jso= n" > *Content-Type: application/json* > > {"modelRequestDTO":{"userTranslation":"dfdfdfd","defaultTranslation":"dfd= fdfdfd"},"userDescription":"dfdfdfdfdfdf"} > --cP4hM4kXJ134rNoUFiCCjcKhk4uzVlZAnFYBdQ-- > > > > Simulating this in JMeter is not very easy as you need to use the 3rd tab > and put the json body in a file. > > This make variabilization of JSON content difficult. > > Ideally It would be much better if parameters table could be used, > but it doesn't work as you cannot set Content-Type for parameters. > > How could we implement such case in the GUI ?: > > - Add a new column that would only be used in some case ? not very nice? = How would we decide wether we use it or not ? > > - Create some new Component (ParameterContentTypeSetter) that would tell = HttpRequest the Content-Type of each parameter > > by its name ? > > - Any other ideas ? > > Thanks > > Regards > > --=20 Cordialement. Philippe Mouawad. --001a113e43ca017f290549d846f4--