How to prepare encoded POST data on javascript?

前端 未结 5 1094
长发绾君心
长发绾君心 2021-01-04 04:10

I need to send data by POST method.

For example, I have the string \"bla&bla&bla\". I tried using encodeURI and got \"bla&bla&bla\" as t

5条回答
  •  鱼传尺愫
    2021-01-04 04:38

    >>> encodeURI("bla&bla&bla")
    
    "bla&bla&bla"
    
    >>> encodeURIComponent("bla&bla&bla")
    
    "bla%26bla%26bla"
    

提交回复
热议问题