polymer form using paper-input and core-ajax

前端 未结 2 946
刺人心
刺人心 2021-01-03 13:37

i am working on a custom element that will serve as a form for sending map node data to a database using a restful service.

i have 3 questions about this element.

2条回答
  •  有刺的猬
    2021-01-03 14:17

    A couple of notes:

    1. Instead of assembling data at send time, it's probably convenient to treat the data as an object in the first place. I called it item (it could be record or node or whatever) and I made it bindable so you could pass in a record for editing.
    2. body is generally for sending data that you format yourself. In this, case since you have normal name='value' pairs that you want to access as such in PHP, use params instead. At that point either GET or POST will work (POST is usually better).

    Updated example:

    
      
      
    
    

提交回复
热议问题