
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
request-json
Advanced tools
Request is a great client for NodeJS, but if you deal only with JSON, things could be more straightforward. This lib aims to simplify Request usage for JSON only requests.
Add it to your package json or run:
npm install request-json
Client = require('request-json').JsonClient
client = new Client 'http://localhost:8888/'
data = title: 'my title', content: 'my content'
client.post 'posts/', data, (err, res, body) ->
print response.statusCode
client.get 'posts/', (err, res, body) ->
print body.rows[0].title
data = title: "my new title"
client.put 'posts/123/', (err, res, body) ->
print response.statusCode
client.del 'posts/123/', (err, res, body) ->
print response.statusCode
data = name: "test"
client.sendFile 'attachments/', './test.png', data, (err, res, body) ->
console.log err if err
client.saveFile 'attachments/test.png', './test-get.png', (err, res, body) ->
console.log err if err
resultStats = fs.statSync('./test-get.png')
client.setBasicAuth('john', 'secret')
client.get 'private/posts/', (err, res, body) ->
print body.rows[0].title
FAQs
HTTP request client for JSON APIs
The npm package request-json receives a total of 2,342 weekly downloads. As such, request-json popularity was classified as popular.
We found that request-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.