aleph

raymcdermott 2017-08-31T14:12:18.000138Z

dumb question … how to use post with http client?

raymcdermott 2017-08-31T14:14:19.000283Z

I get a 401 when calling but it works when using curl / postman

raymcdermott 2017-08-31T14:14:33.000556Z

so I guess the body encoding is wrong in some way

raymcdermott 2017-08-31T14:14:47.000459Z

but help / tips welcome 🙂

raymcdermott 2017-08-31T14:15:16.000162Z

[ reading the http client code hasn’t helped ]

2017-08-31T17:16:46.000438Z

For one thing, your client id and client secret are not the same case

2017-08-31T17:17:13.000205Z

Does auth0 require basic auth? You haven't included any creds for that in the HTTP call

2017-08-31T17:18:51.000256Z

For basic auth, include {:basic-auth [username password]} in your options map to http/get

2017-08-31T17:19:08.000288Z

Or post in this case, I guess

raymcdermott 2017-08-31T18:26:24.000442Z

don’t worry about the parameters

raymcdermott 2017-08-31T18:26:40.000346Z

I just don’t know how to call POST with aleph

raymcdermott 2017-08-31T18:27:32.000529Z

this call (endpoint / body) works with the postman REST client

raymcdermott 2017-08-31T18:27:47.000496Z

so there is nothing wrong with the approach

2017-08-31T19:34:56.000092Z

What's the error you are getting? I'm not familiar with postman.

2017-08-31T19:35:25.000364Z

If it's just a 401, you have an authentication issue, which is why I asked if basic auth is requires

raymcdermott 2017-08-31T19:43:57.000379Z

ok, sorry to have been prickly … no basic auth needed

raymcdermott 2017-08-31T19:44:20.000111Z

it does use x-www-form-urlencoded

stijn 2017-08-31T19:45:27.000331Z

@raymcdermott is it correct (like @ehashman pointed out) that your client-secret has a hyphen instead of underscore?

raymcdermott 2017-08-31T19:46:13.000137Z

maybe I’m being a dick

stijn 2017-08-31T19:47:02.000141Z

okay 🙂

raymcdermott 2017-08-31T19:47:23.000017Z

nope, still 401

stijn 2017-08-31T19:47:46.000224Z

I always use aleph.http/request with :method set to :post

raymcdermott 2017-08-31T19:48:15.000066Z

hmm why?

stijn 2017-08-31T19:48:40.000398Z

(aleph.http/request {:method :post :url "uuuuurrrlll"})

stijn 2017-08-31T19:50:15.000046Z

can you paste the curl request?

raymcdermott 2017-08-31T19:51:11.000023Z

one sec

raymcdermott 2017-08-31T19:54:58.000398Z

holy shit … case sensitive content-type

raymcdermott 2017-08-31T19:55:03.000218Z

it’s working now

raymcdermott 2017-08-31T19:55:04.000361Z

LOL

raymcdermott 2017-08-31T19:55:28.000306Z

so do it the right way from now on @stijn 🙂

stijn 2017-08-31T19:55:29.000594Z

that's a pretty awesome http response code in that case

raymcdermott 2017-08-31T19:55:47.000040Z

auth0 - yeah, the best

raymcdermott 2017-08-31T19:56:28.000059Z

so this is OK now

raymcdermott 2017-08-31T19:57:22.000110Z

@ehashman thanks for your support too

raymcdermott 2017-08-31T21:30:36.000301Z

hmmm … maybe not the content-type …. I tried it with Content-Type and it still worked

raymcdermott 2017-08-31T21:30:54.000498Z

so it’s working and thanks for your support

raymcdermott 2017-08-31T21:31:12.000353Z

probably was the - not being a _

2017-08-31T21:42:04.000231Z

I would agree :)

😝 1