Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
286 views
in Technique[技术] by (71.8m points)

Converting cURL command to Swift URLSession

I'm trying to convert a cURL command my sys admin provided for me to a Swift URLSession and I'm a little confused on a part of it. Here's the command:

curl -s -c cookies -b cookies -X POST -d 'os_username=app_wiki_api' -d "os_password=xxxxxxxxxxxx" 'https://wiki.xxxxxxx.com/dologin.action' > /dev/null

This will return a session cookie. I've run it through the command line successfully and now would like to drop it into a Mac desktop app as part of a project. What I don't understand is the

> /dev/null

part. Is this a way of cURL saying either hit /dologin.action or /dev/null?

I've Googled various iterations of 'What does > do in cURL' and found no references, checked the MAN page, nada.

Another question, when I ran this command (in Terminal on a Mac) I kept getting dquote>, typed in " and it ran but I couldn't tell what was missing to throw that. I even went through and made sure I didn't have any smart quotes in it. I'd always get the same response.

Thanks in advance for the help.

question from:https://stackoverflow.com/questions/66053389/converting-curl-command-to-swift-urlsession

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...