Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-19 Thread ryan embgrets
Thanks for taking time to answer my question. I have put the actual data except the loginId header.. https://play.golang.org/p/KrnxWLVj8s2 But i still get the html content in golang but when i use python i get the invalid api credentials. Due to incorrect loginId header. import requests r = req

Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-19 Thread burak serdar
On Sat, Sep 19, 2020 at 11:47 PM Tamás Gulácsi wrote: > > I bet requests (and curl) encodes the params as multipart/form-data, NOT > query string. > Do the same: https://play.golang.org/p/L4YryKNjju4 A GET request does not have a body. I suggest you print out the request struct completely befor

[go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-19 Thread Tamás Gulácsi
I bet requests (and curl) encodes the params as multipart/form-data, NOT query string. Do the same: https://play.golang.org/p/L4YryKNjju4 remb...@gmail.com a következőt írta (2020. szeptember 19., szombat, 20:44:54 UTC+2): > I am trying to call a simple api by using golang. But, each time it se

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
func clearCurrentLine(){ fmt.Print("\n\033[1A\033[K") } [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owk7j) [owk7j] On September 19, 2020 at 20:04 GMT, Joop Kiefte wrote: package main import "fmt" func main() { fmt.Println("Test 1") fmt.Println("T

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
package main import "fmt" func main() { fmt.Println("Test 1") fmt.Println("Test 2") fmt.Print("\033[1A\033[K") //one up, remove line (should work after the newline of the Println) } Maybe this piece of code helps you? [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-si

Re: [go-nuts] hook into os.Stdout / os.Stderr

2020-09-19 Thread Raffaele Sena
You can create your own writer and overwrite os.Stdout/Stderr (just supply your own write method with the appropriate before/after hooks) Sent from my iPhone > On Sep 19, 2020, at 12:38 PM, Alexander Mills > wrote: > > Forgive me for this pigeon code, I am looking to do something like: > >

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Alexander Mills
Yeah sure so it looks like: clearCurrentLine() // clears the previous status line fmt.Println("foo") writeStatusLine() // writes new status line where clearCurrentLine() is just like func clearCurrentLine(){ //fmt.Printf("\033[0;") // clear current line //fmt.Printf("\033[2K\r%d",0); //fmt.Fp

[go-nuts] hook into os.Stdout / os.Stderr

2020-09-19 Thread Alexander Mills
Forgive me for this pigeon code, I am looking to do something like: os.Stdout.BeforeWrite(func (){ }); os.Stderr.AfterWrite(func(){ }) so I can hook into the system and clear the terminal before hand, and write a status line, after wards. Is this possible? -- You received this message becau

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
Can you give some example code? [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owiru) [owiru] On September 19, 2020 at 19:29 GMT, Alex Mills wrote: Yeah I tried all those ANSI codes, nothing seems to work :( On Sat, Sep 19, 2020 at 11:59 AM Joop Kief

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Alex Mills
Yeah I tried all those ANSI codes, nothing seems to work :( On Sat, Sep 19, 2020 at 11:59 AM Joop Kiefte wrote: > I tend to do that with ANSI terminal codes, there are pages that explain > all codes > > *Joop Kiefte* - Chat @ Spike >

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
I tend to do that with ANSI terminal codes, there are pages that explain all codes [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owh4j) [owh4j] On September 19, 2020 at 18:44 GMT, Alex Mills wrote: Using Node.js with several projects I can use these

[go-nuts] How to clear current line in terminal

2020-09-19 Thread Alex Mills
Using Node.js with several projects I can use these: const rl = require('readline'); process.stdout.write('current line') rl.clearLine(process.stdout); rl.cursorTo(process.stdout, 0); this will clear the current line in the terminal, so I can achieve something like a status line, but I cannot f

[go-nuts] Get request send me hmtl content but works fine from python and curl

2020-09-19 Thread ryan embgrets
I am trying to call a simple api by using golang. But, each time it sends me html content of login page instead of actual data. But same get request works from python and curl. package main import ( "fmt" "io/ioutil" "net/http" "os" ) func main() { client := &http.Client{} req, err := http.N

Re: [go-nuts] What are the best practices for go build tools?

2020-09-19 Thread cpu...@gmail.com
Hi Paul! Thank you for taking the time to reply. On Friday, September 18, 2020 at 11:33:49 AM UTC+2 Paul Jolly wrote: > Hi Andi, > > > 1) I cannot do go install tools.go: > > go install takes main packages as arguments, so no, this will not > work. The tools.go file (like the example you pres