You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If we're dealing with a JSON variant, and our payload is JSON let's make it look a little nicer.
163
+
if(isMimeTypeJSON(postData.mimeType)){
164
+
// If our postData is less than 20 characters, let's keep it all on one line so as to not make the snippet overly lengthy.
165
+
constcouldBeJSON=postData.text.length>2;
166
+
if(couldBeJSON&&prettifyJson){
167
+
try{
168
+
constjsonPayload=JSON.parse(postData.text);
169
+
170
+
// If the JSON object has a single quote we should prepare it inside of a HEREDOC because the single quote in something like `string's` can't be escaped when used with `--data`.
171
+
//
172
+
// Basically this boils down to `--data @- <<EOF...EOF` vs `--data '...'`.
0 commit comments