New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http package not available in 3.0.0 #524

Closed
linoor opened this Issue Mar 14, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@linoor

linoor commented Mar 14, 2016

Hello,

I can't seem to find the Http package in version 3.0.0 even though the elm-package install evancz/elm-http keeps telling me that it's the latest version of the package.

Is it not available in version 3.0.0? Should I use some other version (1.0.0) or is there some new way to make requests?

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Mar 14, 2016

Contributor

What exactly is failing for you? Can you show an example and any error messages you get?

Contributor

jvoigtlaender commented Mar 14, 2016

What exactly is failing for you? Can you show an example and any error messages you get?

@linoor

This comment has been minimized.

Show comment
Hide comment
@linoor

linoor Mar 14, 2016

Ok so basically i'm trying to make a button make a post request with some json data. At first I tried to use post function but when I tested it it turned out that I kept getting 415 Unsupported Media Type error. I figured out that it's beacuse the post function doesn't set the header to application/json. After that I tried using the Http.request function like this:

postJson : String -> Request String
postJson body =
  Http.request "POST" "http://127.0.01.8080/start_timer" body [("Header-Type", "application/json")]

but I kept getting an error:

elm-make main/static/app.elm --yes --warn --output=elm.js
�[36m-- NAMING ERROR -------------------------------------------- main/static/app.elm

Cannot find variable `Http.request`.

44│   Http.request "POST" "http://127.0.01.8080/start_timer" body
      ^^^^^^^^^^^^
`Http` does not expose `request`. Maybe you want one of the following?

    Http.Request

So I tried to look in the docs at http://package.elm-lang.org/packages/elm-lang/core/1.0.0/Http to see why is it like that. I use version 3.0.0 of elm-html (at least that was what the package manager told when when it was installing it) so I wanted to see the docs for version 3.0.0 but I keep getting 404 error here: http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Http. Then I looked in the source and I didn't see Http.elm file for the 3.0.0 tag so that's why I started to wonder if it's not available anymore in that version.

Thanks!

linoor commented Mar 14, 2016

Ok so basically i'm trying to make a button make a post request with some json data. At first I tried to use post function but when I tested it it turned out that I kept getting 415 Unsupported Media Type error. I figured out that it's beacuse the post function doesn't set the header to application/json. After that I tried using the Http.request function like this:

postJson : String -> Request String
postJson body =
  Http.request "POST" "http://127.0.01.8080/start_timer" body [("Header-Type", "application/json")]

but I kept getting an error:

elm-make main/static/app.elm --yes --warn --output=elm.js
�[36m-- NAMING ERROR -------------------------------------------- main/static/app.elm

Cannot find variable `Http.request`.

44│   Http.request "POST" "http://127.0.01.8080/start_timer" body
      ^^^^^^^^^^^^
`Http` does not expose `request`. Maybe you want one of the following?

    Http.Request

So I tried to look in the docs at http://package.elm-lang.org/packages/elm-lang/core/1.0.0/Http to see why is it like that. I use version 3.0.0 of elm-html (at least that was what the package manager told when when it was installing it) so I wanted to see the docs for version 3.0.0 but I keep getting 404 error here: http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Http. Then I looked in the source and I didn't see Http.elm file for the 3.0.0 tag so that's why I started to wonder if it's not available anymore in that version.

Thanks!

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Mar 14, 2016

Contributor

Quite a while ago, the Http module was moved out of the elm-lang/core package, and into the new evancz/elm-http package. So to look at the current docs, you need to visit this page: http://package.elm-lang.org/packages/evancz/elm-http/3.0.0/Http

Contributor

jvoigtlaender commented Mar 14, 2016

Quite a while ago, the Http module was moved out of the elm-lang/core package, and into the new evancz/elm-http package. So to look at the current docs, you need to visit this page: http://package.elm-lang.org/packages/evancz/elm-http/3.0.0/Http

@linoor

This comment has been minimized.

Show comment
Hide comment
@linoor

linoor Mar 15, 2016

Damn, thanks, I guess that closes the issue.

linoor commented Mar 15, 2016

Damn, thanks, I guess that closes the issue.

@linoor linoor closed this Mar 15, 2016

@stoivo

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment