# Question on HTTP.jl

**URL:** <https://discourse.julialang.org/t/question-on-http-jl/56924>\
**Category:** General Usage\
**Created:** [March 11, 2021, 2:02am UTC](https://discourse.julialang.org/t/question-on-http-jl/56924 "2021-03-11T02:02:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sampope](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sampope](https://discourse.julialang.org/u/sampope)\
**Post date:** [March 11, 2021, 2:02am UTC](https://discourse.julialang.org/t/question-on-http-jl/56924/1 "2021-03-11T02:02:27Z")

</div>

Hi, I’m trying to do a lookup on IP addresses using HTTP.jl `[cd3eb016] HTTP v0.9.5`, I purposely put in invalid addresses to see how it responds, and not sure how to access this error:

The request is:

```julia
ipaddr = "10.10.10.10"
response = HTTP.get("$endpoint?apiKey=$apikey&ip=$ipaddr&lang=$language&include=security")

```

the response, slightly anonymized, is:

```julia
ERROR: HTTP.ExceptionRequest.StatusError(423, "GET", "/ipgeo?apiKey=1111&ip=10.10.10.10&lang=en&include=security", HTTP.Messages.Response:
"""
HTTP/1.1 423 Locked
Date: Thu, 11 Mar 2021 01:57:23 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
{"message":"'10.10.10.10' is a bogon (Private network) IP address."}""")

```

response is nil so I can’t seem to access response.status nor response.body

I was expecting response.status to be 423 and the response.body to be `{"message":"'10.10.10.10' is a bogon (Private network) IP address."}`

To be clear, I want access to the status and the “message” included in the error.

What am I missing or doing wrong?

Thanks!

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [March 11, 2021, 1:50pm UTC](https://discourse.julialang.org/t/question-on-http-jl/56924/2 "2021-03-11T13:50:28Z")

</div>

The body is:

```julia
{"message":"'10.10.10.10' is a bogon (Private network) IP address."}

```

And the status code is `423 Locked` as you can see in the error, just like you expect.  
you probably did:

```julia
response = HTTP.get(...) # throws
response == nothing # Nani !?

```

You can’t expect a return value when a function throws an exception.  
Use: `HTTP.get(...; status_exception=false)` to not throw.

---

<div class="post-metadata">

**Author:** ![sampope](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sampope](https://discourse.julialang.org/u/sampope)\
**Post date:** [March 11, 2021, 6:11pm UTC](https://discourse.julialang.org/t/question-on-http-jl/56924/3 "2021-03-11T18:11:57Z")

</div>

Thank you. I somehow missed that setting in HTTP.request docstrings.
