Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@procore/core-http

Package Overview
Dependencies
Maintainers
0
Versions
1751
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@procore/core-http

A HTTP Client

  • 12.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
655
decreased by-11.73%
Maintainers
0
Weekly downloads
 
Created
Source

CORE HTTP

A simple HTTP client.

yarn add @procore/core-http

This simple wrapper over native fetch makes interacting with the Procore API a little easier. By default, it injects a CSRF token from known places when working from inside of an Micro Front End, or in a Hydra Client, but takes in a second parameter that helps you override any value you would need to customize.

Usage

Simple Example
import { request } from '@procore/core-http'

function ExampleRequest() {
  request('/some-url-here')
    .then((response) => console.log(response))
    .catch((err) => console.error(err))
}
With baseUrl option
import { request } from '@procore/core-http'

function ExampleRequest() {
  request('/some-url-here', { baseUrl: 'https://www.example.com' })
    .then((response) => console.log(response))
    .catch((err) => console.error(err))
}
Automatically convert from json response with a text fallback.
import { requestJSON } from '@procore/core-http'

function ExampleRequest() {
  requestJSON('/some-url-here.json')
    .then((response) => console.log(response))
    .catch((err) => console.error(err))
}

Keywords

FAQs

Package last updated on 22 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc