Problem is that the server on other side does not read this well. From what I noticed is that (tracing with wireshark) golang formats this string for every newline with \t\n, but when I send this request via curl, there is only \n.
With curl is like:
Key: content
Value: id: ticket/new\nQueue: General\nRequestor:someting@something…
With go is linke:
Key:content
Value: id: ticket/new\t\nQueue: General\t\nRequest:something@something…
how can i format this that go will send without \t.
Well you indented the lines in the string, so whatever you used to indent will be sent literally to the other side. Remove the indentation in the string and it should work then.
OK, I will past working and not working exp as I do not know what could be wrong. I have removed tabs (/t) but the result is the same. With curl is working, with go I can not get it working.
pasting also how i do it with curl: curl --data-urlencode $'content="id: ticket/new\nQueue: General\nRequestor: [asdasd@asdds.si\nPriority](mailto:asd@asdads.si\nPriority): 1\nSubject: dasfrom command line\nText: tekst vrstica 1\n tekst vrstica 2\n tekst vrstica 3"' 'http://172.31.1.193/rt/REST/1.0/ticket/new?user=root&pass=asdasdas'
I’m not quite sure what exactly it is you’re trying to achieve? Can you provide an example of what you’re expecting as the output and I can try and help?