aswiftnewbie27
aswiftnewbie27

Reputation: 27

How to make a request to a GET request (PHP) from swift 4

My Goal:

Upload some parameters to MYSQL database from my iOS app

What I have done:

I have a working php file that successfully updates my database. When I enter the url into my browser, it echoes the sql string and successfully updates the database

The URL I need to "call" in swift

 http://www.mywebsite.com/myPhpGetRequest.php?&uuid=FGA847B3-F51C-4301-BF46-8B3970A3B193&myFirstparameter=pass

My research

Most of my research has led to questions that rely on JSON. Do I have to use JSON or can I "silently" call this URL?

TL:DR:

I need to call a URL to upload parameters to a database and I am currently lost. I already have an Alamofire dependency in my project.

Upvotes: 1

Views: 129

Answers (1)

MackProgramsAlot
MackProgramsAlot

Reputation: 593

You are really asking how to make an http request in swift.

Look into: https://github.com/Alamofire/Alamofire

import Alamofire

Alamofire.request(.GET, "http://www.mywebsite.com/myPhpGetRequest.php?&uuid=FGA847B3-F51C-4301-BF46-8B3970A3B193&myFirstparameter=pass")

Upvotes: 1

Related Questions