cs-restsharp.js (hoppscotch-2.0.0) | : | cs-restsharp.js (hoppscotch-2.1.0) | ||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
{ verb: "GET", csMethod: "Get" }, | { verb: "GET", csMethod: "Get" }, | |||
{ verb: "POST", csMethod: "Post" }, | { verb: "POST", csMethod: "Post" }, | |||
{ verb: "PUT", csMethod: "Put" }, | { verb: "PUT", csMethod: "Put" }, | |||
{ verb: "PATCH", csMethod: "Patch" }, | { verb: "PATCH", csMethod: "Patch" }, | |||
{ verb: "DELETE", csMethod: "Delete" }, | { verb: "DELETE", csMethod: "Delete" }, | |||
] | ] | |||
// create client and request | // create client and request | |||
requestString.push(`var client = new RestClient("${url}");\n\n`) | requestString.push(`var client = new RestClient("${url}");\n\n`) | |||
requestString.push( | requestString.push( | |||
`var request = new RestRequest("${pathName}${queryString}", ${requestDataF ormat});\n\n` | `var request = new RestRequest("${pathName}?${queryString}", ${requestData Format});\n\n` | |||
) | ) | |||
// authentification | // authentification | |||
if (auth === "Basic Auth") { | if (auth === "Basic Auth") { | |||
requestString.push( | requestString.push( | |||
`client.Authenticator = new HttpBasicAuthenticator("${httpUser}", "${htt pPassword}");\n` | `client.Authenticator = new HttpBasicAuthenticator("${httpUser}", "${htt pPassword}");\n` | |||
) | ) | |||
} else if (auth === "Bearer Token" || auth === "OAuth 2.0") { | } else if (auth === "Bearer Token" || auth === "OAuth 2.0") { | |||
requestString.push( | requestString.push( | |||
`request.AddHeader("Authorization", "Bearer ${bearerToken}");\n` | `request.AddHeader("Authorization", "Bearer ${bearerToken}");\n` | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |