Copy as cURL(cmd) adds invalid characters to form data











up vote
0
down vote

favorite












I want to use Postman to test server side validation so I used the browser to submit (valid) data to the server and in the network tab of Chromes developer tools used "Copy as cURL". Then, in Postman, Import->Paste Raw Text -> Import.



If I look at the request body the data appears on x-www-form-urlencoded tab and every value has a '^' character appended to it. e.g. JobId: 75051^



When I post it the server validation picks it up as invalid data e.g.




The value "75051^" is not valid for JobId




Edit
If I use "Copy as C=cURL(bash)" instead, the ^ characters are removed but the server doesn't like the encoding used on dates and times. e.g. T




The value '11%2F19%2F2018+12%3A15+AM' is not valid for Work Start Time




What is going on here? Can I get "Copy as cURL" to pick up my data correctly, or is there a better way to pick up the request and get it into Postman?










share|improve this question




















  • 1




    ^ is a cmd batch language escape symbol. It's added when you choose "Copy as cURL (cmd)". I think this is a bug in Chrome caused by the lack of understanding that the escape is not needed inside double-quoted strings. See if you can use "Copy as cURL (bash)" instead.
    – wOxxOm
    Nov 19 at 17:37












  • @wOxxOm - see my edit, it helps. But still something odd about the encoding
    – Colin
    Nov 19 at 18:01












  • Might be easier to remove all those ^ especially by using a scripting utility like AutoHotkey to bind Ctrl-V to a simple string replacement on clipboard when invoked in a Postman window.
    – wOxxOm
    Nov 20 at 6:24















up vote
0
down vote

favorite












I want to use Postman to test server side validation so I used the browser to submit (valid) data to the server and in the network tab of Chromes developer tools used "Copy as cURL". Then, in Postman, Import->Paste Raw Text -> Import.



If I look at the request body the data appears on x-www-form-urlencoded tab and every value has a '^' character appended to it. e.g. JobId: 75051^



When I post it the server validation picks it up as invalid data e.g.




The value "75051^" is not valid for JobId




Edit
If I use "Copy as C=cURL(bash)" instead, the ^ characters are removed but the server doesn't like the encoding used on dates and times. e.g. T




The value '11%2F19%2F2018+12%3A15+AM' is not valid for Work Start Time




What is going on here? Can I get "Copy as cURL" to pick up my data correctly, or is there a better way to pick up the request and get it into Postman?










share|improve this question




















  • 1




    ^ is a cmd batch language escape symbol. It's added when you choose "Copy as cURL (cmd)". I think this is a bug in Chrome caused by the lack of understanding that the escape is not needed inside double-quoted strings. See if you can use "Copy as cURL (bash)" instead.
    – wOxxOm
    Nov 19 at 17:37












  • @wOxxOm - see my edit, it helps. But still something odd about the encoding
    – Colin
    Nov 19 at 18:01












  • Might be easier to remove all those ^ especially by using a scripting utility like AutoHotkey to bind Ctrl-V to a simple string replacement on clipboard when invoked in a Postman window.
    – wOxxOm
    Nov 20 at 6:24













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I want to use Postman to test server side validation so I used the browser to submit (valid) data to the server and in the network tab of Chromes developer tools used "Copy as cURL". Then, in Postman, Import->Paste Raw Text -> Import.



If I look at the request body the data appears on x-www-form-urlencoded tab and every value has a '^' character appended to it. e.g. JobId: 75051^



When I post it the server validation picks it up as invalid data e.g.




The value "75051^" is not valid for JobId




Edit
If I use "Copy as C=cURL(bash)" instead, the ^ characters are removed but the server doesn't like the encoding used on dates and times. e.g. T




The value '11%2F19%2F2018+12%3A15+AM' is not valid for Work Start Time




What is going on here? Can I get "Copy as cURL" to pick up my data correctly, or is there a better way to pick up the request and get it into Postman?










share|improve this question















I want to use Postman to test server side validation so I used the browser to submit (valid) data to the server and in the network tab of Chromes developer tools used "Copy as cURL". Then, in Postman, Import->Paste Raw Text -> Import.



If I look at the request body the data appears on x-www-form-urlencoded tab and every value has a '^' character appended to it. e.g. JobId: 75051^



When I post it the server validation picks it up as invalid data e.g.




The value "75051^" is not valid for JobId




Edit
If I use "Copy as C=cURL(bash)" instead, the ^ characters are removed but the server doesn't like the encoding used on dates and times. e.g. T




The value '11%2F19%2F2018+12%3A15+AM' is not valid for Work Start Time




What is going on here? Can I get "Copy as cURL" to pick up my data correctly, or is there a better way to pick up the request and get it into Postman?







google-chrome-devtools postman






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 18:00

























asked Nov 19 at 16:56









Colin

16.5k1481148




16.5k1481148








  • 1




    ^ is a cmd batch language escape symbol. It's added when you choose "Copy as cURL (cmd)". I think this is a bug in Chrome caused by the lack of understanding that the escape is not needed inside double-quoted strings. See if you can use "Copy as cURL (bash)" instead.
    – wOxxOm
    Nov 19 at 17:37












  • @wOxxOm - see my edit, it helps. But still something odd about the encoding
    – Colin
    Nov 19 at 18:01












  • Might be easier to remove all those ^ especially by using a scripting utility like AutoHotkey to bind Ctrl-V to a simple string replacement on clipboard when invoked in a Postman window.
    – wOxxOm
    Nov 20 at 6:24














  • 1




    ^ is a cmd batch language escape symbol. It's added when you choose "Copy as cURL (cmd)". I think this is a bug in Chrome caused by the lack of understanding that the escape is not needed inside double-quoted strings. See if you can use "Copy as cURL (bash)" instead.
    – wOxxOm
    Nov 19 at 17:37












  • @wOxxOm - see my edit, it helps. But still something odd about the encoding
    – Colin
    Nov 19 at 18:01












  • Might be easier to remove all those ^ especially by using a scripting utility like AutoHotkey to bind Ctrl-V to a simple string replacement on clipboard when invoked in a Postman window.
    – wOxxOm
    Nov 20 at 6:24








1




1




^ is a cmd batch language escape symbol. It's added when you choose "Copy as cURL (cmd)". I think this is a bug in Chrome caused by the lack of understanding that the escape is not needed inside double-quoted strings. See if you can use "Copy as cURL (bash)" instead.
– wOxxOm
Nov 19 at 17:37






^ is a cmd batch language escape symbol. It's added when you choose "Copy as cURL (cmd)". I think this is a bug in Chrome caused by the lack of understanding that the escape is not needed inside double-quoted strings. See if you can use "Copy as cURL (bash)" instead.
– wOxxOm
Nov 19 at 17:37














@wOxxOm - see my edit, it helps. But still something odd about the encoding
– Colin
Nov 19 at 18:01






@wOxxOm - see my edit, it helps. But still something odd about the encoding
– Colin
Nov 19 at 18:01














Might be easier to remove all those ^ especially by using a scripting utility like AutoHotkey to bind Ctrl-V to a simple string replacement on clipboard when invoked in a Postman window.
– wOxxOm
Nov 20 at 6:24




Might be easier to remove all those ^ especially by using a scripting utility like AutoHotkey to bind Ctrl-V to a simple string replacement on clipboard when invoked in a Postman window.
– wOxxOm
Nov 20 at 6:24












1 Answer
1






active

oldest

votes

















up vote
0
down vote













I found a better way to pick up the request and get it into Postman:




  1. Install the Postman Chrome App instead of the desktop
    app.

  2. Install the Postman Interceptor Extension.

  3. Open Postman and click on the Interceptor icon in the toolbar to switch the
    toggle to “on”.

  4. Browse to your website: the requests appear in Postman's history.

  5. Go to Interceptor missing from native apps #1667 and vote for it


Reference:



Postman Interceptor Extension Documentation






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379356%2fcopy-as-curlcmd-adds-invalid-characters-to-form-data%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I found a better way to pick up the request and get it into Postman:




    1. Install the Postman Chrome App instead of the desktop
      app.

    2. Install the Postman Interceptor Extension.

    3. Open Postman and click on the Interceptor icon in the toolbar to switch the
      toggle to “on”.

    4. Browse to your website: the requests appear in Postman's history.

    5. Go to Interceptor missing from native apps #1667 and vote for it


    Reference:



    Postman Interceptor Extension Documentation






    share|improve this answer

























      up vote
      0
      down vote













      I found a better way to pick up the request and get it into Postman:




      1. Install the Postman Chrome App instead of the desktop
        app.

      2. Install the Postman Interceptor Extension.

      3. Open Postman and click on the Interceptor icon in the toolbar to switch the
        toggle to “on”.

      4. Browse to your website: the requests appear in Postman's history.

      5. Go to Interceptor missing from native apps #1667 and vote for it


      Reference:



      Postman Interceptor Extension Documentation






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I found a better way to pick up the request and get it into Postman:




        1. Install the Postman Chrome App instead of the desktop
          app.

        2. Install the Postman Interceptor Extension.

        3. Open Postman and click on the Interceptor icon in the toolbar to switch the
          toggle to “on”.

        4. Browse to your website: the requests appear in Postman's history.

        5. Go to Interceptor missing from native apps #1667 and vote for it


        Reference:



        Postman Interceptor Extension Documentation






        share|improve this answer












        I found a better way to pick up the request and get it into Postman:




        1. Install the Postman Chrome App instead of the desktop
          app.

        2. Install the Postman Interceptor Extension.

        3. Open Postman and click on the Interceptor icon in the toolbar to switch the
          toggle to “on”.

        4. Browse to your website: the requests appear in Postman's history.

        5. Go to Interceptor missing from native apps #1667 and vote for it


        Reference:



        Postman Interceptor Extension Documentation







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 at 8:22









        Colin

        16.5k1481148




        16.5k1481148






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379356%2fcopy-as-curlcmd-adds-invalid-characters-to-form-data%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Wiesbaden

            To store a contact into the json file from server.js file using a class in NodeJS

            Marschland