What do you want to save?
Add Code snippet
New code examples
-
C 2021-11-02 17:56:07
Writing tests for API requests
pm.test("Request is successful with a status code of 200", function () { pm.response.to.have.status(200); }); pm.test("Check that it returns an array", function () { var jsonData = pm.response.json(); pm.expect(jsonData).to.be.a... Add solution -
Javascript 2021-11-01 19:08:15
fetch api template
//fetch api template const fetchData=(inputs)=>{ fetch('https://example.com/api', { method: 'post', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(inputs) }) .then(function(response) { return response.json(); ... Add solution -
Other 2021-10-20 21:55:06
postman bearer token
// Add to collection pre scripts // Also don’t forget to set auth in endpoint as {{access_token}} let tokenUrl = 'Your url to get token'; let email = 'Your email'; let password = 'Your password'; if (pm.environment.name === 'Your env') { token... Add solution -
Javascript 2021-10-18 23:59:04
node.js untrusted_authority: The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."
const fetch = require('node-fetch-with-proxy'); async function sendGetRequestAsync(url, options) { const response = await fetch(url, options); const json = await response.json(); const headers = response.headers.raw(); return { headers: Objec... Add solution
Best helpers
Ranking is empty