如何将数据格式化为json,如下所述?

如何将数据格式化为json,如下所述?,json,post,xmlhttprequest,http-post,Json,Post,Xmlhttprequest,Http Post,我正在尝试使用此API: 他们将此作为post请求的示例: order[cards_attributes][0][product_name]=standard order[cards_attributes][0][picture]=@/front.jpg order[cards_attributes][0][name]=Max Mustermann order[cards_attributes][0][street]=Musterstr. 22 order[cards_attributes][0

我正在尝试使用此API:

他们将此作为post请求的示例:

order[cards_attributes][0][product_name]=standard
order[cards_attributes][0][picture]=@/front.jpg
order[cards_attributes][0][name]=Max Mustermann
order[cards_attributes][0][street]=Musterstr. 22
order[cards_attributes][0][zip]=22345
order[cards_attributes][0][city]=Berlin
order[cards_attributes][0][country]=DE
order[cards_attributes][0][text]="This is a greeting text.\nSecond line..."
order[cards_attributes][0][text_color]=#000000
=> Status: 201, Body:
{"id":1950418,"cards":[{"id":1950777,"company":null,"title":null,"name":"Tester","stre
et":null,"zip":null,"city":null,"state":null,"country":"Germany","product_name":"stand
ard","text_color":"#123456","text":"halooooo","picture_id":2386966,"font_id":24,"ship_
date":"2014-02-01"}]} 

知道这是什么格式吗?我试图以json的形式发送数据,但我不知道如何格式化,这个例子也没有什么帮助