# Display struct definition

**URL:** https://discourse.julialang.org/t/display-struct-definition/6564
**Category:** General Usage
**Created:** [October 19, 2017, 4:24pm UTC](https://discourse.julialang.org/t/display-struct-definition/6564 "2017-10-19T16:24:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tawheeler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tawheeler/32/17657_2.png) [@tawheeler](https://discourse.julialang.org/u/tawheeler)
#### Post date: [October 19, 2017, 4:24pm UTC](https://discourse.julialang.org/t/display-struct-definition/6564/1 "2017-10-19T16:24:03Z")

</div>

Is there an easy way to display a struct definition?  
I often find myself wanting to see the fieldnames for a type, for which I can call `fieldnames(mytype)`. This doesn’t give me the corresponding types as well. Is there an easy way to say, call @printstruct(typeof(mytype)) and get:

```julia
struct MyType
    var1::Int
    var2::Vector{String}
end

```

or similar?

---

<div class="post-metadata">

### Author: ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)
#### Post date: [October 19, 2017, 4:35pm UTC](https://discourse.julialang.org/t/display-struct-definition/6564/2 "2017-10-19T16:35:59Z")

</div>

```julia
julia> using HTTP

julia> HTTP.Response
HTTP.Response

julia> dump(HTTP.Response)
HTTP.Response <: Any
  status::Int32
  major::Int16
  minor::Int16
  cookies::Array{HTTP.Cookies.Cookie,1}
  headers::Dict{String,String}
  body::HTTP.FIFOBuffers.FIFOBuffer
  request::Nullable{HTTP.Request}
  history::Array{HTTP.Response,1}

```
