Never did anything like that yet. But my guess you can begin w/ these links below:
p5js.org/reference/#/p5/httpDo