Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 무료 백엔드 배포
- flex-grow
- css 오버레이
- Sass
- Node.js
- Express
- Prototype
- improve-iq-by-up-to-10%!
- flex-basis
- flex-shrink
- 정규표현식
- express-handlebars
- regExp
- module wrapper function
- close together
- css
- es6
- Engoo
- shit-christmas
- css grid
- ajax
- node
- img 확대
- css variables
- 디자인패턴
- flexbox
- select by attribute
- JS
- Object.create
- just-one-small-sip
Archives
- Today
- Total
AJAX POST request 본문
Content-Type 헤더를 지정해주는 것과 보낼 데이터를 JSON 문자열로 변경하여 보내야 하는 점에 주의하자.
// Make an Http POST Request
EasyHttp.prototype.post = function (url, data, callback) {
this.http.open("POST", url, true);
this.http.setRequestHeader("Content-type", "application/json");
let self = this;
this.http.onload = function () {
callback(null, self.http.responseText);
}
this.http.send(JSON.stringify(data));
};
'2021 프론트 엔드 로드맵 따라가기 > JS' 카테고리의 다른 글
ES6 Fetch API (0) | 2021.06.09 |
---|---|
ES6 Promise (0) | 2021.06.09 |
AJAX 이용 시 주의할 점 (0) | 2021.06.07 |
Callback function (0) | 2021.06.07 |
REST API (0) | 2021.06.07 |
Comments