NebulousLabs / go-skynet

An SDK for integrating Skynet into Golang applications
MIT License
16 stars 8 forks source link

Sample code error found . #19

Closed v1xingyue closed 4 years ago

v1xingyue commented 4 years ago

I simplely run the sample code like this .

package main

import (
    "fmt"

    skynet "github.com/NebulousLabs/go-skynet"
)

func main() {
    // upload
    skylink, err := skynet.UploadFile("./src.jpg", skynet.DefaultUploadOptions)
    if err != nil {
        fmt.Printf("Unable to upload: %v", err.Error())
        return
    }
    fmt.Printf("Upload successful, skylink: %v\n", skylink)

    // download
    err = skynet.DownloadFile("./dst.jpg", skylink, skynet.DefaultDownloadOptions)
    if err != nil {
        fmt.Printf("Something went wrong, please try again.\nError: %v", err.Error())
        return
    }
    fmt.Println("Download successful")
}

But after , build and run , one error happened. Any one can tell me why .

Error Content :

Unable to upload: [could not execute request; error code received; 400 response from POST: failed parsing Content-Type header: mime: no media type; error response]
mrcnski commented 4 years ago

Thanks for submitting the report, looks like this has been broken for a while and we didn't catch it!

I've done some investigation and determined the problem, will push a fix shortly.

mrcnski commented 4 years ago

Please see #20. We'll go through the review process but in the meantime you can just check out and use that branch