Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
const xmlhttp = new XMLHttpRequest(); xmlhttp.onload = function() { const myObj = JSON.parse(this.responseText); console.log(myObj) myObj.forEach(function(o) { document.getElementById("datos").innerHTML += '
' + o.nombre + '
'; }) }; xmlhttp.open("GET", "api/v1/productos/listar"); xmlhttp.send(); const xhttp = new XMLHttpRequest(); xhttp.onload = function() { document.getElementById("datos").innerHTML = this.responseText; } const miobj = { name: "Televisor", precio: 300, stock: 19, img: "tv.jpg" }; const mijson = JSON.stringify(miobj); xhttp.open("POST", "api/v1/productos/insertar"); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(mijson);
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)