How to use the popsicle.post function in popsicle

To help you get started, we’ve selected a few popsicle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LearningLocker / learninglocker / ui / src / redux / modules / auth / login.js View on Github external
doAction: function* loginSaga({ username, password }) {
    const { status, body } = yield post(`/api${routes.AUTH_JWT_PASSWORD}`)
      .use(basicAuth(username.toLowerCase(), password));
    if (status > 200 && status < 500) throw new Error(body.message || body);
    else if (status >= 500) throw new Error('There was an error communicating with the login server.');
    else {
      yield put(tokenActions.decodeLoginTokenAction(body));
      yield put(routerActions.navigateTo('home'));
    }
  }
});
github LearningLocker / learninglocker / ui / src / utils / LLApiClient.js View on Github external
postModel = (schema, props, params = {}) =>
    post(this.constructRequest(schema, params, props, props))