[elm-discuss] Re: Encoding JSON and updating

2017-11-20 Thread David Legard
OK, thanks, I didn't fully understand your previous message. I'll do some more tinkering with this. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+u

[elm-discuss] Re: Encoding JSON and updating

2017-11-20 Thread Steve Schafer
Like I said in my previous message, you can't send data to that URL. That URL identifies the *entire* database. With PUT, PATCH, and DELETE, you have to use a URL that identifies a *specific *record in the database. The error message also says that the body of the request is empty, but I can't

[elm-discuss] Re: Encoding JSON and updating

2017-11-20 Thread David Legard
OK, thanks for the suggestions. There's something going on beyond my comprehension level. I can read the data from http://localhost:3000/db, but when I try to send it back, even with an Http.emptyBody, I get: BadStatus { status = { code = 404, message = "Not Found" }, headers = Dict.fromList

[elm-discuss] Re: Encoding JSON and updating

2017-11-19 Thread Steve Schafer
One other thing: You need to add a *Content-Type: application/json *header to the request. On Sunday, November 19, 2017 at 5:35:53 AM UTC-5, David Legard wrote: > > I'm testing it on *localhost*. > > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" gro

[elm-discuss] Re: Encoding JSON and updating

2017-11-19 Thread Steve Schafer
The tutorial uses json-server, which, by default, expects PATCH requests to go to a specific player's URL, not the top-level URL for all players. I haven't played with the tutorial myself, so the following may not be 100% accurate, but I think that you need to: 1. Give each player an ID fiel

[elm-discuss] Re: Encoding JSON and updating

2017-11-19 Thread Roman FroĊ‚ow
For uploading files I typically forward people to https://github.com/simonh1000/file-reader/tree/master/example -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to e

[elm-discuss] Re: Encoding JSON and updating

2017-11-19 Thread David Legard
I'm testing it on *localhost*. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.go