Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Custom Headers & small corrections
Browse files Browse the repository at this point in the history
added support for custom headers.
smalls corrections :
- removed @Property for m_OData_etag in TableEntry (Allready in super class)
- changed m_headers allocation to NSMutableDictionary Type in DataServiceStreamResponse l.51
- added @synthesize for m_entityFKRelation in ObjectContext (@Property existing but no @syntesize)
-Changed allocation type to NSMutableArray in ObjectContext.m l.1562
  • Loading branch information
Gwennin Le Bourdonnec committed Jan 26, 2012
1 parent 3429b41 commit 862b18e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion Framework/src/MSODataLib/Azure/TableEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

}

@property(nonatomic,retain, getter=getEtag, setter=setEtag: )NSString *m_OData_etag;

@property(nonatomic,retain, getter=getObjectID, setter=setObjectID: )NSString *m_OData_obectID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (id) initWithHttpResponse:(HttpResponse*)aHttpResponse
}
else
{
m_headers = [[NSMutableArray alloc] init];
m_headers = [[NSMutableDictionary alloc] init];
}

}
Expand Down
10 changes: 8 additions & 2 deletions Framework/src/MSODataLib/Context/ObjectContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ @implementation ObjectContext
@synthesize m_Credential;
@synthesize m_entities;
@synthesize m_timeOutInterval;
@synthesize m_entityFKRelation;

+ (void)initialize
{
Expand Down Expand Up @@ -610,7 +611,12 @@ -(HTTPHandler*) executeHTTPRequest:(NSString *)aUri httpmethod:(NSString *)metho
else
httpdata = [[NSData alloc] initWithData:[body dataUsingEncoding:NSUTF8StringEncoding]];

HTTPHandler * httpHandler = [self executeHTTPRequest:aUri httpmethod:method httpbodydata:httpdata etag:etag customHeaders:nil];
HTTPHandler * httpHandler = nil;
if ([m_customHeaders count] != 0)
httpHandler = [self executeHTTPRequest:aUri httpmethod:method httpbodydata:httpdata etag:etag customHeaders:m_customHeaders];
else
httpHandler = [self executeHTTPRequest:aUri httpmethod:method httpbodydata:httpdata etag:etag customHeaders:nil];

[httpdata release];
return httpHandler;
}
Expand Down Expand Up @@ -1553,7 +1559,7 @@ - (void) attachLocation:(ODataObject*)anODataObject location:(NSString*)aLocatio

-(void) setEntitiesWithArray:(NSArray *)anArray
{
[self setEntities:[[[NSArray alloc]initWithArray:anArray] autorelease] ];
[self setEntities:[[[NSMutableArray alloc]initWithArray:anArray] autorelease] ];
}


Expand Down

0 comments on commit 862b18e

Please sign in to comment.