2012-12-10 22 views
7

numaralı kutudan uygulama/x-www-form-urlencoded uygulamasını destekliyor mu? Bir üçüncü tarafın bir uygulamayı/x-www-form-urlencoded uygulamasının gönderilmesi için bir hedefe izin vermesi için bir api kurmaya çalışıyorum.WebApi,

Sadece webapi ile json ve xml ile çalıştım.

Bunu kabul etmek için özel bir mediatype oluşturmanız mı gerekiyor yoksa varsayılan olarak mı çalışmalıyım?

Herhangi bir öneri takdir edilecektir.

GÜNCELLEME

ancak ben benim API benziyor için webhook gönderecek verilerinin bir örneğini için emin hala değilim sağlanan örneğe göz aldı.

Denetleyicimi bunu kabul etmek için nasıl ayarlamalıyım?

POST /some-path HTTP/1.1 
Host: your.host.example.com 
Content-Type: application/x-www-form-urlencoded 
Content-Length: 2837 
Connection: keep-alive 
Accept: /

environment=prod&domain_prefix=example&type=product.update&payload=%7B%22id%22%3A%229fe945bc-2d20-11e2-8057-080027706aa2%22%2C%22retailer_id%22%3A%229a5521c3-2d20-11e2-8057-080027706aa2%22%2C%22sku%22%3A%229416050901074%22%2C%22handle%22%3A%221000001%22%2C%22source%22%3A%22USER%22%2C%22active%22%3A%221%22%2C%22name%22%3A%22Ginger+Beer%22%2C%22description%22%3A%22%3Cp%3EA+delicious+ginger+beer+that+is+both+refreshing+and+good+value+for+money.%3C%5C%2Fp%3E%22%2C%22supplier%22%3A%7B%22id%22%3A%229fc84329-2d20-11e2-8057-080027706aa2%22%2C%22retailer_id%22%3A%229a5521c3-2d20-11e2-8057-080027706aa2%22%2C%22name%22%3A%22Brewer+Supplies+Ltd.%22%2C%22description%22%3A%22We+supply+all+things+brewed%5Cn%22%2C%22source%22%3A%22USER%22%7D%2C%22brand%22%3A%7B%22id%22%3A%229fb8e69d-2d20-11e2-8057-080027706aa2%22%2C%22name%22%3A%22Vaughan%27s+Ginger+Beer+Brewing+Company%22%7D%2C%22inventory%22%3A%5B%7B%22product_id%22%3A%229fe945bc-2d20-11e2-8057-080027706aa2%22%2C%22outlet_id%22%3A%229aee412b-2d20-11e2-8057-080027706aa2%22%2C%22attributed_cost%22%3A%221%22%2C%22count%22%3A%2222%22%2C%22reorder_point%22%3A%2212%22%2C%22restock_level%22%3A%2240%22%7D%2C%7B%22product_id%22%3A%229fe945bc-2d20-11e2-8057-080027706aa2%22%2C%22outlet_id%22%3A%229ae97219-2d20-11e2-8057-080027706aa2%22%2C%22attributed_cost%22%3A%221%22%2C%22count%22%3A%2214%22%2C%22reorder_point%22%3A%226%22%2C%22restock_level%22%3A%2220%22%7D%5D%2C%22price_book_entries%22%3A%5B%7B%22id%22%3A%22a1098b59-2d20-11e2-8057-080027706aa2%22%2C%22product_id%22%3A%229fe945bc-2d20-11e2-8057-080027706aa2%22%2C%22price%22%3A%222.00%22%2C%22tax%22%3A%220.25%22%2C%22type%22%3A%22BASE%22%2C%22customer_group_id%22%3A%229b097e69-2d20-11e2-8057-080027706aa2%22%2C%22customer_group_name%22%3A%22All+Customers%22%2C%22tax_id%22%3A%229a025ff0-2d20-11e2-8057-080027706aa2%22%2C%22tax_name%22%3A%22NZ+GST%22%2C%22tax_rate%22%3A%220.150000%22%7D%2C%7B%22id%22%3A%22a1318cf0-2d20-11e2-8057-080027706aa2%22%2C%22product_id%22%3A%229fe945bc-2d20-11e2-8057-080027706aa2%22%2C%22price%22%3A%221.90%22%2C%22tax%22%3A%220.24%22%2C%22type%22%3A%22GENERAL%22%2C%22customer_group_id%22%3A%229b097e69-2d20-11e2-8057-080027706aa2%22%2C%22customer_group_name%22%3A%22All+Customers%22%2C%22tax_id%22%3A%229a025ff0-2d20-11e2-8057-080027706aa2%22%2C%22tax_name%22%3A%22NZ+GST%22%2C%22tax_rate%22%3A%220.150000%22%7D%2C%7B%22id%22%3A%22a13a6320-2d20-11e2-8057-080027706aa2%22%2C%22product_id%22%3A%229fe945bc-2d20-11e2-8057-080027706aa2%22%2C%22min_units%22%3A%2210.00%22%2C%22price%22%3A%221.50%22%2C%22tax%22%3A%220.19%22%2C%22type%22%3A%22BASE%22%2C%22customer_group_id%22%3A%229b097e69-2d20-11e2-8057-080027706aa2%22%2C%22customer_group_name%22%3A%22All+Customers%22%2C%22tax_id%22%3A%229a025ff0-2d20-11e2-8057-080027706aa2%22%2C%22tax_name%22%3A%22NZ+GST%22%2C%22tax_rate%22%3A%220.150000%22%7D%5D%7D

+0

olası yinelenen http://stackoverflow.com/questions/11593595/ bir-orada-a-yol-için-kolu-form-sonrası veri-in-a-web aPI-kontrol) –

cevap