---
# System prepended metadata

title: 將 Json 陣列資料傳到後端
tags: [語法堂]

---

# 將 Json 陣列資料傳到後端
###### tags: `語法堂`

## Json 的陣列是 [] 包起來的，若 {} 的話是物件

### 物件↓
![](https://i.imgur.com/mDwybOz.png)

### 陣列↓
![](https://i.imgur.com/KrNOHmj.png)

##  只要 Property 跟 Model Property 同名就抓的到哦

## Script
```
var data = [];
//[
//        { "TicketId": "150", "PendingJournalMoney": "100" },
//]

data.push({ "TicketId": "2222", "PendingJournalMoney": "222" });

$.post({
    url: "@Url.Action("CreateJournal", "PaymentFlow")",
    data: JSON.stringify(data),
    dataType: "json",
    contentType: "application/json",
    success: function (response) {
        alert(response);
    }
})
```