Giter VIP home page Giter VIP logo

Comments (5)

pineray avatar pineray commented on May 29, 2024

APIから返ってくるパラメーターがJSONなのは良いとして、
APIへ渡すパラメーターが JSON なのは、受け取る側(EC-CUBE)にとっては簡単かもしれませんが、
API を利用する側にとってはパラメーターの作成が面倒です。

jQuery だと、以下の様になり、冗長であるように思います。

var postData = {id:1, name:"てすと"};
jQuery.post({
    "http://example.com/api/customer",
    {json:JSON.stringify(postData)},
    function(data){
      ...
    }
});

from ec-cube.

shinichi-takahashi avatar shinichi-takahashi commented on May 29, 2024

@pineray
そうですね。おっしゃる通り、こちらは

var postData = {id:1, name:"なまえ"};
$.post({
    "http://example.com/api/customer",
    postData,
    function(data){
    }
});

こんな感じで渡せるといいですかね?

from ec-cube.

pineray avatar pineray commented on May 29, 2024

@shinichi-takahashi

そうですね。そのほうが、WebAPI を使う側にとって分かりやすいと思います。

from ec-cube.

sreyleaktouch avatar sreyleaktouch commented on May 29, 2024

Any one can help me, How to create API of product detail using ECCUBE

from ec-cube.

chihiro-adachi avatar chihiro-adachi commented on May 29, 2024

API機能に関する課題を別途整理のため、本issueはクローズします。

from ec-cube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.