Giter VIP home page Giter VIP logo

play-slick's Introduction

play-slick's People

Contributors

olivebh avatar tasuki avatar

Stargazers

 avatar Miguel Canessa avatar  avatar TAN PENG avatar Bartek avatar Evan Mancini avatar sāmīr avatar  avatar  avatar takayuki murata avatar Sakib Hadžiavdić avatar csyangchsh avatar Myriam avatar Farbod Saff avatar

Watchers

 avatar

play-slick's Issues

JSON Payload to associate Person with Address

Thanks a lot OliveBH Dev Team for this great tutorial!
I am now running your application perfectly. I manage to POST new addresses and new persons with empty address list.

However, when I try to POST a person completed with list of addresses, I get 400 Bad request. Here follow the details of the request I submit:

POST http://localhost:9000/persons
Headers:

Accept: *.*
Content-Type: application/json

Payload:

{"personId" : 1,
    "name" : "Serif",
    "phones" : [
        { "phoneId" : 0, "number" : "+353851148224" },
        { "phoneId" : 10, "number" : "+387 61/000-333" }
    ],
    "addresses" : [ {"addressId" : 1}]
}

I've also tried:

{
    "personId" : 4,
    "name" : "Serif",
    "phones" : [
        { "phoneId" : 9, "number" : "+387 61/000-222" },
        { "phoneId" : 10, "number" : "+387 61/000-333" }
    ],
    "addresses" : [
        { "addressId" : 2, "street" : "Ferhadija" },
        { "addressId" : 3,  "street" : "Gechet" }
    ]
}

So far the only request that returns 200 OK is the following:

{
    "personId" : 4,
    "name" : "Serif",
    "phones" : [
        { "phoneId" : 9, "number" : "+387 61/000-222" },
        { "phoneId" : 10, "number" : "+387 61/000-333" }
    ],
    "addresses" : []
}

So I wonder, how can I specify a reference between a person and an address via your RESTful API? Thanks in advance!

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.