#Sending HTTP Request

1 messages · Page 1 of 1 (latest)

umbral laurel
#

Hi everyone, I'm trying to build an authentication server using gleam. I'm currently trying to implement some logic to send the user a welcome email when they sign up. Here's what I've got so far

plucky sinew
#

Do you need any help or just showing what you got?

umbral laurel
#

The main issue is that, somehow the Content-Type of the request is being set to application/octet-stream (I confirmed by running a proxy on port 9000)

umbral laurel
umbral laurel
#

the Content-Type: application/json changed to application/octet-stream

plucky sinew
#

Probably httpc does some magic. I haven't used it, can't say for sure. I'd try with another http client or dive into the source code of httpc to find out what's going on

clear briar
#

try lower case "content-type"

umbral laurel
umbral laurel
#

can't belive that fixed it

#

thanks y'all

plucky sinew
#

Funny

umbral laurel
#

The issue was fixed by changing the http headers to lowercase

umbral laurel
#

how do I mark this question as answered?

clear briar
#

http standards are intriguing.

#

or the implementations.

#

I believe standard says lowercase, but many (not all!) systems work with CamelCase or at least accept it.

umbral laurel
#

oh wow

#

that's really interesting, does that mean that other frameworks that allow uppercase are basically doing their own thing/ not fully implementing the spec?

clear briar
#

ah, found it. http 1, case insensitive, http 2 lower case

plucky sinew
#

Interesting, it basically means that no one abides by the one true standard and many choose to, probably, win in performance avoiding additional to_lower_case