This is a migrated thread and some comments may be shown as answers.

App crashing with Segmentation fault: 11

2 Answers 96 Views
NativeScript Insiders
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Akhil
Top achievements
Rank 1
Akhil asked on 16 Jan 2015, 04:00 AM
Hey everyone,

I'm trying to develop my first mobile app with NativeScript and am encountering an issue when trying to do an HTTP post request - the only messages I am seeing in XCode are "failed with error(4: ios/kern) invalid argument)" and "service exited due to signal: Segmentation fault: 11." Looking these up on Google didn't really help.

The code for my post request is as follows (I am trying to send an email using PostMark). Any help would be greatly appreciated!

    http.request({ 
        url: "https://api.postmarkapp.com/email", 
        method: "POST",
        content: {
            "From": **My email**,
            "To": **Recipient**,
            "Subject": "Test",
            "HtmlBody": "<b>Hello!</b>",
            "TextBody": "Hello",
            "Headers": [
                {
                    "Name": "X-Postmark-Server-Token",
                    "Value": **API Token**
                }
            ]
        }
    }).then(function(response) {

    }, function(error) {
        console.log(error);
    });

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 16 Jan 2015, 07:09 AM
Hi,

Please use JSON.stringify() to post JSON content. You can check this thread for more info:
http://www.telerik.com/community/forums/http-module-issue-on-ios

Regards,
Vlad
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Akhil
Top achievements
Rank 1
answered on 16 Jan 2015, 09:40 AM
This worked, thanks so much!
Tags
NativeScript Insiders
Asked by
Akhil
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Akhil
Top achievements
Rank 1
Share this question
or