Closed Tyrasuki closed 7 years ago
local pay = http.post("http://krist.ceriat.net/transactions", "to=k5n6r931i1&privatekey=xxxxxxxx&amount="..payamm.."&metadata=test").readAll()
print(pay) -- checking for errors
read the wiki next time.
lemmmy, does the privatekey have to be encoded or can it be just plain text?
it will have to be encoded if it uses any non-ascii characters, or any of the following characters:
character | codepoint (hex) |
---|---|
(space) | 20 |
" | 22 |
# | 23 |
$ | 24 |
% | 25 |
& | 26 |
+ | 2B |
, | 2C |
/ | 2F |
: | 3A |
; | 3B |
< | 3C |
= | 3D |
> | 3E |
? | 3F |
@ | 40 |
in other words, yes. always url-encode all user input.
local pay = http.post("http://krist.ceriat.net/transactions", "to=k5n6r931i1&privatekey=" .. textutils.urlEncode(privatekey) .. "&amount="..payamm.."&metadata=test").readAll()
print(pay) -- checking for errors
please take further issues to the CC forums, and not my repository. this is a place for bug reports, not programming help.
so, i've been trying to make a transaction through computercraft, since im working on a shop, but whenever i try to pass my privatekey through the http.post, it just errors the following:
even tho i posted the key with the http.post
code used to send request:
if there is anything im doing wrong here please tell me, i've been looking over the internet for more than an hour.